missing ) in parenthetical
Posted
by
Elgoog
on Stack Overflow
See other posts from Stack Overflow
or by Elgoog
Published on 2010-12-30T03:48:05Z
Indexed on
2010/12/30
3:54 UTC
Read the original article
Hit count: 181
I'm modifying BSN's Autosuggest script so it will work with codeigniter, the only proble is I cant seem to figure out why it displays "missing ) in parenthetical" says the problem is around else
_b.AutoSuggest.prototype.setSuggestions = function (req, input)
{
if (input != this.fld.value)
return false;
this.aSug = [];
if (this.oP.json)
{
var jsondata = eval('(' + req.responseText + ')');
for (var i=0;i<jsondata.results.length;i++)
{
this.aSug.push( { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info } );
}
}
else
{
var xml = req.responseXML;
// traverse xml
//
var results = xml.getElementsByTagName('results')[0].childNodes;
for (var i=0;i<results.length;i++)
{
if (results[i].hasChildNodes())
this.aSug.push( { 'id':results[i].getAttribute('id'), 'value':results[i].childNodes[0].nodeValue, 'info':results[i].getAttribute('info') } );
}
}
this.idAs = "as_"+this.fld.id;
this.createList(this.aSug);
};
Any help would be appreciated, i'm not very good at JS
© Stack Overflow or respective owner