add util function to escape strings for manual building of HTML, and use this for the portal title

fix #319
This commit is contained in:
Jon Atkins
2013-05-27 00:35:56 +01:00
parent e609c64775
commit bfd9f39067
2 changed files with 9 additions and 1 deletions

View File

@ -54,7 +54,7 @@ window.renderPortalDetails = function(guid) {
$('#portaldetails')
.attr('class', TEAM_TO_CSS[getTeam(d)])
.html(''
+ '<h3 class="title">'+d.portalV2.descriptiveText.TITLE+'</h3>'
+ '<h3 class="title">'+escapeHtmlSpecialChars(d.portalV2.descriptiveText.TITLE)+'</h3>'
+ '<span class="close" onclick="unselectOldPortal();" title="Close">X</span>'
// help cursor via ".imgpreview img"
+ '<div class="imgpreview" '+imgTitle+' style="background-image: url('+img+')">'