Passing String parameter into Javascript
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开发者_如何学Go(<%=testing%>)"
> Click </a>
How can I resolve it?
I 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 ''
精彩评论