When I send HTML code to an iframe using a java servlet and the js side, I am parsing json from the HTML by encapsulating it in a <div>
tag with jQuery. However, sometimes additional text is added to the string that is being sent back.
If the added text contains a word enclosed in angle brackets, Firefox automatically closes the brackets, which is not desired.
For instance, when I send this:
<div>{"location":[],"columns":["<case expression>","headers"]}</div>
Firefox (specifically Firefox so far, not IE or Chrome) interprets it as:
<div>{"location":[],"columns":["<case expression>","headers"]}</case></div>
This alteration messes up my parsing process. I have tried changing the Content-Type
header to application/json
, but the iframe will not display the content unless the type is set to text/html
.
If anyone has a solution to this issue, I would greatly appreciate it. I am open to trying different methods of sending the data if necessary.