jquery - passing var with quote from parent to child in javascript -


i try differents ways of passing variables parent child jquery , ve got issues text containing quote:

in child popup create html element embedding javascript calling method parent, 1 of variable (label) string can contains quote, if try display content on parent page, string cut after first quote.

.data( "ui-autocomplete" )._renderitem = function( ul, item ) {   $('#grille_table').append( "<tr><td><img onclick=parent.updatefunction('"+ item.id +"',this.title,this.src); src=/uploads/media/source/"+ item.image +" width=100 height=100 title='"+ item.label +"' />"+ item.label +"" ); 

how can achieve ?

thx

i think mean

.data( "ui-autocomplete" )._renderitem = function( ul, item ) {   $('#grille_table').append(     '<tr><td><img onclick="parent.updatefunction(\''+    item.id +   '\',this.title,this.src);" src="/uploads/media/source/'+    item.image +   '" width="100" height="100" title="'+    item.label +   '" />'+ item.label); } 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -