469,631 Members | 1,532 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

missing ) after argument list?

I have the following code.
Expand|Select|Wrap|Line Numbers
  1. function updateTermsList() {
  2.     var termDivBox = document.getElementById("termarea");   
  3.     var terms = searchXMLHttp.responseXML.getElementsByTagName("term");
  4.     for(var i=0;i<terms.length;i++){
  5.         var name = terms[i].childNodes[1].firstChild.nodeValue;
  6.         var value =  new String(terms[i].childNodes[0].firstChild.nodeValue);
  7.  
  8.        var a = document.createElement('div');
  9.        termDivBox.appendChild(a);
  10.        a.innerHTML = '<a href="#" onclick="refreshDefinitionArea('+value+');">'+name+'</a>'; 
  11.  
  12.     }
  13. }
  14.  
everytime i run it, the same error pops up for this function refreshDefinitionArea(): missing ) after argument list
here is the error on firebug:
missing ) after argument list
refreshDefinitionArea(BSGO:0005363);

any ideas??
Jan 26 '07 #1
2 17702
found the answer:
Expand|Select|Wrap|Line Numbers
  1. <a href="#" onclick="refreshDefinitionArea(\''+value+'\');">'+name+'</a>'; 
thanks
Jan 26 '07 #2
acoder
16,027 Expert Mod 8TB
Yes, when you see a message like that (missing parentheses), the first thing you should look at are unescaped quotes.
Jan 27 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Conrad Weyns | last post: by
1 post views Thread by soup_or_power | last post: by
77 posts views Thread by Ville Vainio | last post: by
5 posts views Thread by Vv_vV | last post: by
4 posts views Thread by Pasquale | last post: by
8 posts views Thread by A. Anderson | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.