jsp - How to pass a second argument to a javascript function -


i'm working on jsp containing javascript function :

function validerselection(identifiant, page) {    var form = objectid("profilform");    form.elements['checkedlogin'].value = "" + identifiant;    form.elements['pageliste'].value = "" + page;    form.method.value = '<bean:message key="button.valid"/>';    window.location = "/stfpresentation/admin/profilutilisateursearch.do?method="         + form.method.value + "&nom=" + identifiant + "&page=" + page; } 

the function worked wanted add second parameter (called page). "page" variable of jsp.

i'm calling javascript function clicking on link :

<a href="javascript:validerselection('<core:out value="${item.nom}"/>', '<%=numero_page%>')"><core:out value="${item.nom}" /></a> 

but nothing happens then. mistake ?

many thanks

you may need add escapes:

try this:

<a href="javascript:validerselection('<core:out value=\'${item.nom}\'/>', '<%=numero_page%>')"><core:out value="${item.nom}" /></a> 

without using escapes, you're creating wrong sequence of open/close quotes


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -