Javascript - JQuery append function and using quotes

davidv

New Member
I have a large append function in my code. In this append function, i am populating an textarea with some text. In this text, I can also have quotes (") and this is causing problems because my append function will interprete those quotes as breaking quotes, and it should not.Do you have an ideao on how to escape those quotes? Thank you.EDIT: Here is my append function:\[code\]$('#add_affiliation').append( '<div id="affiliation_'+affiliation_id+'title" class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">'+ '<span id="affiliation_title'+affiliation_id+'" class="ui-dialog-title">Affiliation '+affiliation_id+'</span>'+ '<a href="http://stackoverflow.com/questions/13699964/#delete_affiliation" id="delete_affiliation_'+affiliation_id+'" onclick="deleteAffiliation(\''+affiliation_id+'\');" >'+ '<img style="float:right" src="http://stackoverflow.com/css/images/delete_affiliation.png" />'+ '</a>'+ '</div>'+ '<div id="affiliation_'+affiliation_id+'content" class="ui-dialog-content ui-widget-content">'+ '<label for="add_affiliations"></label>'+ '<div id="add_affiliation_'+affiliation_id+'" style="overflow: hidden" class="element">'+ '<table id="affiliation_table" style="table-layout:fixed;">'+ '<tbody>'+ '<tr>'+ '<td style="height:30px; width:65px;" align="right"><font size="2"><b>N
 
Back
Top