开发者

The string "ďťż" appears on my page randomly but only in firefox. IE and chrome don't have this problem.

开发者 https://www.devze.com 2023-04-09 03:01 出处:网络
Nothing actually prints that anywhere in my code. So far i\'ve found it in only two places one of them being:

Nothing actually prints that anywhere in my code. So far i've found it in only two places one of them being:

<li class="spatiu"> </li>
<li class="memento_li"> 
    <div id="afisare_alerte">
    <script language="javascript">
    开发者_开发知识库    afisare_alerte_php();
    </script>
</div> 
</li>';

and this is "afisare_alerte_php()"

xmlhttp_alerte.onreadystatechange=function() {
    if (xmlhttp_alerte.readyState == 4) {                                               
         if(document.getElementById("afisare_alerte").innerHTML=xmlhttp_alerte.responseText){
         }
         schimbare_tip_cursor('default');
    }
    else{
        schimbare_tip_cursor('progress');
    }
};

well the ajax part of it.

the file it loads is

<?php
    echo'
    0 Notificari
';
?>

and the output :

ďťż 0 Notificari


That sequence ďťż is called the Windows Byte Order Mark. It shows up whenever you save a file as UTF in most Windows programs. So the problem here is that you must be serving that ajax endpoint from a Windows server, and the server is configured to output a BOM. How to fix this depends on what web server you are using.


Those characters actually do exist in your code, you just can't see them. Some editors add these when the file is saved as UTF. Too see the characters, open your code in an ISO-only editor (e.g. a simple notepad program). You'll be able to see the ďťż then, and you can do a global search/replace to just remove all instances of it. Then save your file.

0

精彩评论

暂无评论...
验证码 换一张
取 消