开发者

document.body not working in IE on a page that has been redirected to?

hoping you can help with this.

I have a link th开发者_如何学JAVAat redirects to a page on another one of our sites

However, when this redirect happens, I get a "document.body is null" error from JQuery, and a similar error from SWFAddress (_d.body is null); but only in IE.

However, when I enter the redirected to URL directly in IE (aka sans interstitial redirect), the JS error disappears. It seems this error only comes up when this page is being redirected to. Any ideas?

I heard similar issues happened when the document doesn't validate with its given Doctype (XHTML 1.0 Transitional in this case). The page had minor issues, but I've recoded the page to make sure it validated via the W3C validator on our DMZ server. Unfortunately, that doesn't seem to resolve the issue.

Any ideas what could be causing this? I talked to several Presentation coders on my team and they seem to be stumped. Any assistance at all is greatly appreciated.

Thanks in advance, - Frank


Are you trying to access document.body outside of a "document.ready" scenario? IE tends to have problems with modifying the DOM before it's fully created, and will choke because of it.

Specific code samples would help a bit here; viewing the source in the links you provided didn't provide much insight, sadly.


For what it's worth: we were able to fix a similar problem with deferred loading of swfaddress (add defer="defer" to swfaddress' script tag).


We found a work around. We setup a page that does a JS redirect instead of the original server side redirect we used. Using this method seems to have resolved the issue. Still, a very odd bug though...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜