1

Our site has several affiliates that use a JavaScript widget to display the latest content available in an ad space. It's all JavaScript powered. The insert the script in the right place, and our rails app generates some rhtml to get inserted. On Wednesday, this suddenly stopped working in IE. Every other browser displays the code just fine, except IE. Could someone point me in a direction on how to resolve this?

Here is the offending code:

document.write('<div id="std-widget" style="width:300px;height:250px;text-align:center;border-style:none;">');
document.write('<a href="<%= @hrefPath %>" target="_blank">')
<% if @deal %>
  document.write('<img src="<%= @imagePath %>" style="border-style:none;" alt="Today\'s Deal in <%= @affiliate.market.name %> - <%= @deal.subject.gsub("'","\\\\'") %>" />');
<% else %>
  document.write('<img src="<%= @imagePath %>" style="border-style:none;" alt="Sign Up Today for Great Deals in <%= @affiliate.market.name %>" />');
<% end %>
document.write('</a>');
document.write('</div>');

Is there something in there that IE suddenly dislikes? Thanks!

Zong
  • 6,160
  • 5
  • 32
  • 46
Kevin Whitaker
  • 12,435
  • 12
  • 51
  • 89
  • 2
    What did you change on your end? Someone alter the code, the server configuration, serving different content type, etc? Most browsers do not just stop working. Load the external JS file directly in the browser, does it load? What is the error message? – epascarello Nov 27 '10 at 13:27
  • Sorry, that's a good point. It's IE 8, IE 8 compatibility mode, and IE 7. Probably IE 6 as well, but we haven't gotten reports on it. The problem is that the elements don't get written like they should. It seems to load the javascript, but then fails to write the new elements to the DOM. – Kevin Whitaker Nov 27 '10 at 14:31
  • possible duplicate of [IE8 hangs on document.write with "this command is not supported"](http://stackoverflow.com/questions/6248246/ie8-hangs-on-document-write-with-this-command-is-not-supported) – Paul Sweatte May 12 '14 at 17:36
  • Possible duplicate of [jquery dynamic iframe - !document.write and IE issues](http://stackoverflow.com/questions/13318143/jquery-dynamic-iframe-document-write-and-ie-issues) – Paul Sweatte Sep 26 '16 at 17:09

0 Answers0