Reputation:
String link = "javascript:document.forms[0].submit() onClick=\"return processParams(" + classOid + ")\" "; classbreadCrumbSelect.add("" + className + ""); //Load the link into my arrayList
for (String unitkey : unitbreadCrumbSelect) {
out.print(" | " + unitkey + " | ");
} //outputs to the JSP.
The error states that ) is missing and says page done with errors in IE.
The link works perfectly and does what I want. Basically I just need to know if there is a syntax error or if IE is just being annoying.
Upvotes: 0
Views: 235
Reputation: 67137
If I understand correctly, this chunk of HTML will be written to the client:
<a href="javascript:document.forms[0].submit() onClick="return processParams(classOid)"">
Perhaps you wanted it to look like:
<a href="javascript:document.forms[0].submit()" onClick="return processParams(classOid)">
Please check your JSP's output -- I suspect the quotes in your link
string are wrong.
[EDIT] From the comments, the HTML output is:
<a href='javascript:document.forms[0].submit()' onClick="return processParams(wt.projmgmt.admin.Project2:282144)" >Unit 3</a>
The problem is the argument to processParams()
:
processParams(wt.projmgmt.admin.Project2:282144)
This is not valid JavaScript: Syntactically a ')' is missing after 'Project2'. Maybe you want to add quotes to treat the argument as a string?
Upvotes: 4
Reputation: 207501
You need to view the page source and look at what your code is generating. Looking at what your serverside is going to output is never as good as looking at what it does output.
The view source should show you typos that you made, missing quotes, and so on.
Upvotes: 0