Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript: missing ) after argument list

This javascript produces an error:

missing ) after argument list

In firebug with the code:

<script type=\"text/javascript\">
function add( answer )
{   
  $.post('../page.php?cmd=view&id=3523', 
    {user_id: 3523, other_user_id: 2343}, function(d)
      $(answer).after(\"<span>Done!</span>\").remove();
    });
  }
}
</script>

What am I doing wrong?

like image 607
Lea Avatar asked Dec 08 '09 09:12

Lea


People also ask

What does missing after argument list?

The JavaScript exception "missing ) after argument list" occurs when there is an error with how a function is called. This might be a typo, a missing operator, or an unescaped string.

How do I fix SyntaxError missing after argument list?

The "SyntaxError: missing ) after argument list" occurs when we make a syntax error when calling a function, e.g. forget to separate its arguments with a comma. To solve the error make sure to correct any syntax errors in the arguments list of the function invocation. Copied!

What is an argument list JavaScript?

arguments is an Array -like object accessible inside functions that contains the values of the arguments passed to that function.


1 Answers

function d misses an opening bracket, {

$(answer).after( should not be escaped \", just a regular quote will do "

like image 152
David Hedlund Avatar answered Oct 19 '22 05:10

David Hedlund