你好,我有這樣的代碼在我的jsp在我的jsp逃脫撇號
<a href="#"onclick="supprimerProduit('<bean:write name="gererProduitsForm" property="type_produit.nomProduit"/>','supprimerProduit','',<bean:write name="gererProduitsForm" property="type_produit.idProduit"/>)"></a>
所以我有一個JavaScript錯誤,當我有例如
在我的VAR托馬的
<bean:write name="gererProduitsForm" property="type_produit.nomProduit"/>
我該如何逃避撇號? Thx
嗨,Mercer!是不是你的questin重複http://stackoverflow.com/q/1470768? – brandizzi 2011-04-27 13:36:02
也許但我該如何在我的jsp中使用這個http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html#escapeJavaScript%28java.lang.String%29? – Mercer 2011-04-27 13:38:42
[如何在JSP上使用撇號或引號(由javascript使用)](http://stackoverflow.com/questions/1470768/how-to-escape-apostrophe-or-quotes-on-a-jsp -used-by-javascript) – 2011-04-27 13:43:34