Very random and annoying problem with IE6. We keep our common JS files on a resources server so we only have to up开发者_如何学Godate them in one place. As well as our custom classes we also keep our build of mootools and more on the resources server and link to it in the head of our sites.
This is fine in all the browsers accept IE6. In IE6 it seems to not loads the core quick enough from the external link before trying to process the mootools code in my site.js file. It will go wrong on the first line "windows.addEvent".
If i put a mootools core in a folder where the site is though its fine. Does anyone know why it might be doing this and if so a way around it, but still keeping the files on the resources domain?
Thanks Tom
@neil . Yeah exactly. Quite frankly i didn't want to be rude but the first two responses were a waste of their time and mine. Someone correcting a typo and someone else saying not to bother supporting a browser that still has 9% share of the market, quite brilliant.
@Dimitar Thanks for your response. I can't change the event to load unless you mean in native JS because no mootools will work. I don't like mixing the native JS when i'm using a framework if i can help it. Never heard of "defer" though, i will def try that. Thanks for your help.
IE6 probably pipelines the download as an extra host gives it the ability to do it in parallel.
perhaps you can either try adding defer='defer' for IE6 for your chunk of code that relies on mootools or change the event from domready to load instead (also for IE) (I tend to use the latter)
精彩评论