2

I'm building a site with lots of file uploads, I use BlueImp's jQuery fileupload plugin

It goes smooth until IE: Firstly, IE9 tries to download the .js file and complains about "dangerous content". I fixed it by setting the content_type to text/plain as it said in the plugin's documentation.

In IE8, even if "text/plain" is set, IE tries to download the .js file again so I tried to "text/html" and it worked... with simple scripts responses.

However, functions inserting HTML with after() or html() fail.

Some code in rails:

$(this).html("<%=j image_tag(@ph.image.url(:thumb)) %>");

In IE's connection debugger (F12) the response text looks like:

$(this).html("<img alt=\"2\" src=\"/system/phs/images/000/000/601/thumb/2.jpg?1378955682\" />");

but at the same time my development log tells me that there was a bad uri request:

[2013-09-12 12:14:44] ERROR bad URI `/%22/system/placeholders/images/000/000/601/thumb/2.jpg?1378955682\\"'.

So I supose it is a problem with some text transformation which happens when IE receive my js script and in its header content type is text/html. Please, help me with that, may be I miss some quotation rules?

Mike Lyons
  • 1,748
  • 2
  • 20
  • 33
Roaring Stones
  • 1,054
  • 7
  • 22
  • It looks like the escaped quotes are getting turned into HTML escape character %22, see this question and answer: http://stackoverflow.com/questions/4251284/raw-vs-html-safe-vs-h-to-unescape-html – Mike Lyons Oct 29 '13 at 01:17

0 Answers0