Before the start of the request, I have beforeSend which puts the download image in the element, after the data from the server is received, they are inserted into the same site element. Works in FF, Safari, Opera, Chrome, but in IE there is only a picture of the download and that's it, nothing happens here is the code

javascript:

var log = function(msg){ console.log ? console.log(msg) : alert(msg); } function load(file, settings) { $('.body').ajaxStart(function(){ $('.body').html('<img src="http://vk.com/images/progress7.gif">'); }); $('.body').ajaxStop(function(){ log('Данные загружены!'); }); $.ajax({ url: file+".php", cache: true, //scriptCharset: "CP1251", success: function(data){ $('.body').html(data); } }); } 

php:

  <?php header('Content-Type: text/plain; charset=cp1251'); include ('db.php'); $select = "SELECT * FROM links WHERE id=5"; $pro = mysql_query($select, $dblink); $row = mysql_fetch_assoc($pro); echo $row['text']; ?> 

    2 answers 2

    By the way, maybe this is your case. See how the server responds in http headers.

     Content-Type text/html; charset=utf-8 

    If the encoding is specified with an error, let's say

     Content-Type text/html; charset=utf8 

    That donkey in these cases tupit.

    • @Arni everything is fine with me, initially everything worked, but there was no hider in the fps and all the data received were krakozyblyami, put the hider worked, but then decided to put the progress bar and that's it .. all refused to work, I always had coding 1251, even if I commemorate the utf-8, it still doesn't work in IE! - Michael Nikolaev
    • All the guys, the ten-hour changes are finished, the problem was that in the php files the header table with the coding is 1251, but it was necessary to put the windows-1251 encoding - Mikhail Nikolaev
    • No, well, okay, yes? What have I told you above? - Arni
    • @Arni thanks for the help, of course, but my encoding was not utf-8, but Wed 1251, I also knew about the joke with the dash, but in this case it did not help me, I decided to change to windows-1251 and it worked))) ) - Michael Nikolaev
    • I utf-8, took as an example. Try to read carefully what you are advised. ))) - Arni

    If you are sending html, then put on the server the header "Content-Type: plain/text" .

    • @aretmy put the headlines, and nothing has changed: ( - Michael Nikolaev
    • Try text / plain more - Artem Yeliseyev
    • @aretmy, nothing happened. - Michael Nikolaev