The first one weeks of casual play, in the JSP <a onclick= "Click (Parameters 1, Parameters 2, Parameters 3)" > hyperlink </a> pass parameter request Ajax when the uncaught syntaxerror: Missing after argument list this error, go to the Internet to inquire about this error, found is lost), caused the problem, but how to check the parentheses are not missing, the code is as follows:
<a target= "_blank" onclick= "click" (<%=user.id%>,<%=user.name%>,<%=user.number%>) "class=" Blue "> View </a> <!--via Ajax request to UserQuery query class--> <script type=" Text/javascript "> function Click (id,name,n umber) {$.ajax ({type: "post", url: "/student/userinfo/userquery.htm?id=" + Escape (ID) + " ;" +escape (name) + "&" +escape (number), data:{"id": ID, "name": Name, "number": Number}, DataType:
' Text ', Success:successmsg, error:errormsg}) function errormsg () {
$ ("Div.dialog"). Show ();
$ ("#info"). HTML ("Error querying user Information");
function Successmsg (msg) {if (msg = = "SUCCESS") {$ ("Div.dialog"). Show ();
$ ("#info"). HTML ("query succeeded");
else {$ (' Div.dialog '). Show ();
$ ("#info"). HTML ("Query failed"); }} </script>
Click to see the hyperlink when you will report uncaught syntaxerror:missing) After argument list this error, after viewing if only with one parameter <%=user.id%> for int type will not have this problem, When three parameters are passed, the code must be modified when there are parameters that are not of type int, and the code is modified as follows:
<a target= "_blank" onclick= "click" (' <%=user.id%> ', ' <%=user.name%> ', ' <%=user.number%> ') class = "Blue" > View </a>
The Ajax request method does not need to change, so that will not report this error, JS often reported some errors, so you need to carefully check the code, such as to see whether the data transmission when the format is problematic, without a semicolon, the data is less, less parentheses and so on.
The above content is for reference only, thank you.