Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

urgent..plz help..syntax problem

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
IN
i have to pass a jsp variable to a javascript function....the below syntaxis not working...any help..

<body onLoad = &quot;javascript:setCookie(<%=concat%>);&quot;>


thanks in advance
-Sourabh
 
Look at the source code and see if <%=concat%> is resolving to what you expect it to. For example if <%=concat%> is supposed to resolve to foobar then you should have in your browser's view-source:
<body onLoad = &quot;javascript:setCookie(foobar);&quot;>

If that is the case, post your question in the JavaScript forum, else post back here.

Hope this helps,
petey

 
also, do not use the &quot;javascript:&quot; pseudoprotocol in an event handler.

wrong:
<body onLoad = &quot;javascript:setCookie(<%=concat%>);&quot;>

right:
<body onLoad = &quot;setCookie(<%=concat%>);&quot;> =========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top