English 中文(简体)
Internet Explorer only part loading JavaScript/CSS
原标题:

I m having trouble with my local development environment where IE (6 through to 8) is only part loading JavaScript/CSS files. It throws random errors at random places in jquery.min.js every time I refresh, which suggested to me that it s trying to execute before it s finished loading or the connection was closed before it finished loading.

I ve looked at the responses using Charles and Apache is returning the correct content-length header for the files I m having trouble with but the text response is always truncated.

I also tried disabling g-zip compression, as I noticed that responses to IE don t have the Content-Encoding: g-zip header, but that breaks things in Firefox (in the same way) and doesn t fix the problem with IE.

I ve looked at my Apache config and it is no different to the staging server where I m not experiencing these issues.

问题回答

I ve changed this line:

BrowserMatch bMSIEs(7|8) !no-gzip !gzip-only-text/html

to this:

BrowserMatch MSIE !no-gzip !gzip-only-text/html

In my config and that seems to fix it, still not sure why it s working differently locally.

The directives causing the browser to load stuff - scripts, images, etc. are executed asynchronously. If your javascript is not self contained I mean relies on anything from any other file, you should not try to execute it using inline statements - you have no way of knowing whether this other file completed loading.

What you need to do is to trigger execution from the page loaded event





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签