Reputation: 8166
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?
Upvotes: 2
Views: 12491
Reputation: 1302
downloadPopup('<%=testing%>')
dont forget to put string in ''
Upvotes: 0
Reputation: 449395
I think you are missing quotes around your string:
<% String testing = "DSfsdsfd" ; %> <a
href="javascript:downloadPopup('<%=testing%>')"
> Click </a>
Upvotes: 3