JS file generated with PHP does not load at first time in IE6
I have some js file generated with php., name by example "my_file.js.php", served with appropriate content-type for JS.
In FF, IE7, Chrome, etc.. all works fine, these files are correctly loaded.
But, in IE6, ths is more complicated : - first load of the page : file is not loaded, and consequently, I have some JS errors on my page - If I did a page refresh, all is now ok
Did anyone of us experience some strange behaviour like this ? (it seems clearly linked to the fact the 开发者_JAVA技巧files are not "pure" .js files, because my other .js files are correctly loaded.
I got it !
After all, the problem was not linked to JS.. but my PHP.
I have a call to "session_start", and it seems that the "no-store" header sent by this call was no very well managed by IE6.
I added a session_cache_limiter('none'); before my call to session_stat and all is now OK.
For french speakers, here is some informations : http://www.developpez.net/forums/d619691/php/langage/sessions/header-session_start-sous-ie/#post3691413
Well, it's hard to say without the source, but maybe you could try putting the defer attribute in your script. That way your script might get loaded after the body, circumventing the error.
精彩评论