I am passing String parameter into javascript . But it is not being called. this is my script:
function downloadPopup(testing){
alert(testing); }
I am calling the javascript like this from my jsp page:
<% String testing = "DSfsdsfd" ; %> <a
href="javascript:downloadPopup(<%=testing%>)"
> Click </a>
How can I resolve it?
I am passing String parameter into javascript . But it is not being called. this is my script:
function downloadPopup(testing){
alert(testing); }
I am calling the javascript like this from my jsp page:
<% String testing = "DSfsdsfd" ; %> <a
href="javascript:downloadPopup(<%=testing%>)"
> Click </a>
How can I resolve it?
Share Improve this question edited May 9, 2012 at 12:03 Daniel Fischer 184k18 gold badges317 silver badges435 bronze badges asked Jan 23, 2010 at 22:08 Gnaniyar ZubairGnaniyar Zubair 8,17623 gold badges64 silver badges72 bronze badges2 Answers
Reset to default 3I think you are missing quotes around your string:
<% String testing = "DSfsdsfd" ; %> <a
href="javascript:downloadPopup('<%=testing%>')"
> Click </a>
downloadPopup('<%=testing%>')
dont forget to put string in ''