最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Site works in Firefox and Chrome but not Internet Explorer - Stack Overflow

programmeradmin0浏览0评论

Apologies but this is not a programming question, but it may have a programming answer.

For some reason my site, will not display properly in IE (I'm using version 8) but it's fine in firefox and chrome. The content does not appear in the centre of the screen in IE and also generates two JS error messages while the pages are loading.

I've tried enabling Active X and Scripts in the security settings but with no joy. I've also looked around the net but cannot find an answer, well not one that works!

Unfortunately I know nothing about javascript so really don't know where to start with the error messages that are generated.

Any help appreciated.

regards

Nigel

Update:

OK initial error has gone, I'd screwed up with a directory name - apologies.

I've found out that if I disable the option to display the last twitter feed in the wordpress theme it loads OK. So it is the JS code in a php script called thememx-document.js that is causing the error. The code generating the error is "var twitterHtml = jQuery.cookie(twitterCookieName);" It says it's charcater 4, which is a space but I don't understand this.

I can live without Twitter on this site but it still leaves issues as to why content isn't centred nor the pop-up ad is not showing (pare to Firefox) but this may not be a programming issue that warrants a question on this site.

Thanks to all for your ments and input.

Nigel

Apologies but this is not a programming question, but it may have a programming answer.

For some reason my site, http://pctools.alwinsights. will not display properly in IE (I'm using version 8) but it's fine in firefox and chrome. The content does not appear in the centre of the screen in IE and also generates two JS error messages while the pages are loading.

I've tried enabling Active X and Scripts in the security settings but with no joy. I've also looked around the net but cannot find an answer, well not one that works!

Unfortunately I know nothing about javascript so really don't know where to start with the error messages that are generated.

Any help appreciated.

regards

Nigel

Update:

OK initial error has gone, I'd screwed up with a directory name - apologies.

I've found out that if I disable the option to display the last twitter feed in the wordpress theme it loads OK. So it is the JS code in a php script called thememx-document.js that is causing the error. The code generating the error is "var twitterHtml = jQuery.cookie(twitterCookieName);" It says it's charcater 4, which is a space but I don't understand this.

I can live without Twitter on this site but it still leaves issues as to why content isn't centred nor the pop-up ad is not showing (pare to Firefox) but this may not be a programming issue that warrants a question on this site.

Thanks to all for your ments and input.

Nigel

Share Improve this question edited Feb 5, 2011 at 15:06 Nigel asked Feb 5, 2011 at 12:30 NigelNigel 11 gold badge1 silver badge2 bronze badges 1
  • 2 Site works in Firefox and Chrome but not Internet Explorer That's like saying "there's tension in the middle east" or "there's fog in London" :-) – Sean Patrick Floyd Commented Feb 5, 2011 at 13:20
Add a ment  | 

4 Answers 4

Reset to default 2

Start with valid code; a validator will pick up lots of problems. Among yours is content before the Doctype, which triggers quirks mode. Quirks mode causes browsers to emulate bugs in ancient browsers and bee much more inconsistent with each other. One of the emulated bugs in Internet Explorer breaks standard centring techniques.

for not properly disply-- its the problem of CSS ...IE7 and IE8 dosen't support css3.so you should simply make another css stylesheet for IE and call it on page only if someone visit your site using IE. and for other broswers it will show exiting style.

and abot JS error --you should check all your php coding and then fix it. its not JS problem. if you are not familar with PHP coding then i am here to offer my free service to you or anyone else. i will help you as i can.

First, having problems with any version of IE is expected and the norm. IE is the worst browser on the planet.

You have a link element on your first line. Links belong inside the head element. Placing it on the first line throws IE into 'quirks mode' and then IE bees even worse than it normally is.

Good.

OK, maybe your site has to work for IE. 9 times out of 10, the problem is a terminal ma. The following is understood in real browsers but generates an unintelligible error in IE:

var x = [ 1, 2, 3, ];

The tenth time (in my experience), it's string indexing.

var x = "abc";
var c = x[2];

In a real browser, c is set to "c"; in IE, another unhelpful error message.

If this helps, remember: in IE, it's very important to create as many circular dependencies as possible. That is, attach to DOM elements JavaScript functions that have references to other DOM elements. IE fails to clean up such dependencies when the user leaves your site and so leaks memory. Once it leaks enough memory, IE slows and eventually freezes the OS and the user learns a valuable lesson: don't use IE. (Microsoft has a good page explaining how to do this although, inexplicably, they remend against doing it.)

发布评论

评论列表(0)

  1. 暂无评论