IE on PC (when i have to test) seems to also like complaining about javascript where it says it doesn't find object but then the script proceed to work anyway. And I thought id'ed document objects were loaded into an array when the page loads to.

I seem to recall that you can install a script debugger on windoze but i never really played with it long enough to see if it was useful or not.

I haven't played with mozilla js debugger I'll have to give it a go. But the only one available when i used to do a lot of dhtml development was in the old ns4 vs ie4 days and the two doms were too far apart for them to be useful.

On 26 Feb 2004, at 13:18, Andrew Hill wrote:

Mozilla has a JavaScript debugger that is very very useful for stepping
through the code to see where the error crops up. Worth downloading and
learning to use. Has saved many hours time for me I can say!

(alerts() are still very useful though. Espcially for bugs that only come up
in IE!)


-----Original Message-----
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 February 2004 18:58
To: Struts Users Mailing List
Subject: Re: JavaScript Parameter



First when debuging javascript alert boxes are handy.

alert(this.form,'<%= val %>')

or

alert(this.form,'<c:out value="${val}" />')

or on tc 5

alert(this.form,'${val}')

if that does what you want start debuging the functions by using alert
boxes.

function myfunction(form,val) {
        alert(form.name);
        alert(val);
}

onclick="myfunction(this.form,'<%= val %>')"

if you use double quotes like you seem to be you may have to escape
them, generally easier to use ' rather than " when calling functions in
the html (in the actual script I prefer to stick to " as more
readable).

and so on. You should get to the bottom of your problem soon enough.

On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:

Hi,
I have a scriptlet
<% String val=obj.getValue("Key"); %>
I need to use this value to be passed as a javascript parameter inorder
to set a property value.


<html:image pageKey=".." altKey=".."
onclick="jsFunction(form,"<%=val%>")" />
The parameter value is not being passed to jsFunction

This works when I use a hardcoded value
<html:image pageKey=".." altKey=".." onclick="jsFunction(form,"1234")"
/>


I have tried these variations aswell
<html:image pageKey=".." altKey=".."
onclick="jsFunction(form,<%=val%>)" />
<html:image pageKey=".." altKey=".."
onclick="jsFunction(form,'<%=val%>')" />

Cud somebody please tell me the correct way to do this.
Regards,
Anirudh




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to