javascript - how to pass data with quotation(") to a dialog in jQuery -



javascript - how to pass data with quotation(") to a dialog in jQuery -

supposed have next code:

<html:link onclick="jquery('#add').data('name','${name}').dialog('open');" href="#">

and this, if ${name} = a"b"c, problem occurs, link not rendered well. have tried escape value, serialize maybe way wrong.

any suggestion how this? have been searching, cant find answer.

thanks in advance.

you need escape quotes or take out of dom (which recommend) putting listener on it:

$('a').click(function(){ $('#add').data('name','${name}').dialog('open'); });

javascript jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -