Hello:
I'm experiencing a problem with the following script using Yahoo's YUI 2.5.2:
Code:
<div class="yui-skin-sam">
<div id="myAutoComplete" style="margin-bottom:3em; width:25em;">
<input id="keywords" type="text">
<div id="autoCompleteContainer"></div>
</div>
<script type="text/javascript">
<!--
var dataSource = new YAHOO.widget.DS_ScriptNode("http://localhost:8080/?action=autocomplete", ["keywords", "keyword"]);
var autoComplete = new YAHOO.widget.AutoComplete("keywords", "autoCompleteContainer", dataSource);
//-->
</script>
</div>
The service that is called by the DS_ScriptNode widget is written in java and uses json-lib-2.2.2. It returns the following:
{"keywords":[{"keyword":"java"},{"keyword":"jboss"}]}
Upon typing in the inputfield, firebug shows me the following error:
invalid label
Naturally, I've searched the web for this error and it is due to the way the json-tree is evaluated by javascript. For it to function properly, the json-tree must be enclosed in paranthesis, like so:
({"keywords":[{"keyword":"java"},{"keyword":"jboss"}]})
However, it seems to me (as far as I have been able to determine som far), that all evaluations done by the YUI-library enclose the json-tree like that. So, does anyone have any ideas where I could look next?
All help will be much appreciated
