Sorry if this has been asked before. I couldn't find anything that resolved this issue for me.
I have Google Maps API pulling data from a mySQL database via PHP. The results are plotted on the map as markers.
From there, I am using Bootstrap to display a modal window when a marker is clicked. The content of the modal is coming dynamically from the database.
Everything is working fine EXCEPT one of the database fields is populated with a HTML string coming from a rich text input. Something simple like this:
<b>this is bold text</b>
When I put this string directly into my javascript listener like this:
$('.modal-body').html('<b>this is bold text</b>');
the HTML is parsed fine and I get the expected output with bold text and no visible tags.
But when I use the string queried from the database like this:
$('.modal-body').html(content);
it is displayed as raw text with tags showing and no formatting.
This is the test page I am working with http://www.toyonder.com/mapTest/mapTest.html
Any ideas how I would go about getting the queried string to render as HTML?
htmlspecialchars()) before inserting or after selecting it from your database. We'll need to see the code (PHP and JavaScript) that populates yourcontentvariable before being able to answer this properly.phpsqlajax_genxml2.phpscript, I can see that thecontentparameters are indeed HTML encoded, iecontent="&lt;b&gt;This is Bold Text&lt;/b&gt;". Quick question, why XML?