Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does not jQuery .attr() work in IE9?
    text
    copied!<p>The following code is just a combination of HTML, CSS and JavaScript "injected" to an existing iFrame ('iframe_id'). Although the following code works for Firefox, Chrome and Safari, it does not work in IE9. I checked some of the related and existing answers, and most of them are related to issues in IE8 or older, which does not help in this case. Is it something related to jQuery .attr()? Does IE9 have issues with it (like older IE versions)? If yes, how can I fix it?</p> <pre><code>$("#iframe_id").attr( "src", "data:text/html;charset=utf-8," + "&lt;!DOCTYPE html&gt;"+ "&lt;html&gt;"+ "&lt;head&gt;"+ "&lt;style&gt;"+ "/********** CSS stuff here **********/"+ "&lt;/style&gt;"+ "&lt;/head&gt;"+ "&lt;body&gt;"+ "&lt;!--------- HTML stuff here ----------&gt;"+ "&lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"&gt;&lt;" + "/script&gt;" + "&lt;script&gt;"+ "/*********** jQuery stuff here *****/"+ "&lt;" + "/script&gt;"+ "&lt;/body&gt;"+ "&lt;/html&gt;" ); </code></pre> <p>In IE9, I get the typical "The webpage cannot be displayed..." error.</p> <p>I already reviewed the following answers, but that did not help.</p> <p><a href="https://stackoverflow.com/questions/7052182/alternative-for-jquery-attr-in-ie">Alternative for jQuery attr() in IE?</a></p> <p><a href="https://stackoverflow.com/questions/17870383/attr-not-working-in-ie">attr() not working in IE</a></p> <p><a href="https://stackoverflow.com/questions/12652284/jquery-attr-do-not-work-in-ie">jquery attr() do not work in IE</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload