missing ) after argument list?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ehsansad
    New Member
    • Jan 2007
    • 2

    missing ) after argument list?

    I have the following code.
    Code:
    function updateTermsList() {
        var termDivBox = document.getElementById("termarea");   
        var terms = searchXMLHttp.responseXML.getElementsByTagName("term");
        for(var i=0;i<terms.length;i++){
            var name = terms[i].childNodes[1].firstChild.nodeValue;
            var value =  new String(terms[i].childNodes[0].firstChild.nodeValue);
       
           var a = document.createElement('div');
           termDivBox.appendChild(a);
           a.innerHTML = '<a href="#" onclick="refreshDefinitionArea('+value+');">'+name+'</a>'; 
    
        }
    }
    everytime i run it, the same error pops up for this function refreshDefiniti onArea(): missing ) after argument list
    here is the error on firebug:
    missing ) after argument list
    refreshDefiniti onArea(BSGO:000 5363);

    any ideas??
  • ehsansad
    New Member
    • Jan 2007
    • 2

    #2
    found the answer:
    Code:
    <a href="#" onclick="refreshDefinitionArea(\''+value+'\');">'+name+'</a>';
    thanks

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Yes, when you see a message like that (missing parentheses), the first thing you should look at are unescaped quotes.

      Comment

      Working...