tags:

views:

113

answers:

2
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.

+4  A: 

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?

Ferdinand Beyer
<a href='javascript:document.forms[0].submit()' onClick="return processParams(wt.projmgmt.admin.Project2:282144)" >Unit 3</a> This is the exact output to Tomcat
Thank you, this fixed the output and the error is gone. I reformatted it so that the contents of processParams() now writes with quotes around it.processParam("") etc. Works great, thanks for the help Ferdinand
A: 

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.

epascarello
<a href='javascript:document.forms[0].submit()' onClick="return processParams(wt.projmgmt.admin.Project2:282144)" >Unit 3</a> This is the exact output to Tomcat