You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Lowe <ma...@talk21.com> on 2004/02/26 14:22:16 UTC

[ot]Re: JavaScript Parameter

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:mark.lowe@talk21.com]
> 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: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [ot]Re: JavaScript Parameter

Posted by Mark Lowe <ma...@talk21.com>.
yeah thanks..

you know, i'd never thought of that..



On 26 Feb 2004, at 15:39, Jim Theodoridis wrote:

> Another solution is to to see the source of the page
> ie->View->source
>
>
> ----- Original Message -----
> From: "Mark Lowe" <ma...@talk21.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, February 26, 2004 3:22 PM
> Subject: [ot]Re: JavaScript Parameter
>
>
>> 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:mark.lowe@talk21.com]
>>> 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: struts-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [ot]Re: JavaScript Parameter

Posted by Jim Theodoridis <st...@tera.gr>.
Another solution is to to see the source of the page 
ie->View->source


----- Original Message ----- 
From: "Mark Lowe" <ma...@talk21.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, February 26, 2004 3:22 PM
Subject: [ot]Re: JavaScript Parameter


> 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:mark.lowe@talk21.com]
> > 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: struts-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org