English 中文(简体)
参考文件。 准备的活动:国际电子计算中心的行为方式不同
原标题:Wiring document.ready event: IE behaving differently

我用于打字:<代码>$(功能){}; syntax to te activities and do other uff in document preparedevent。 但是,我注意到,国际电子8协会在要求某些公司的职能时遇到了问题。 如果该网页没有设计器的密码,我就无法打碎该页面(他用一些幻灯:D)。 幻灯法使用旧的<代码>$(文件)ready(功能({}); syntax,正在使用。 我删除了我的法典,用幻灯 in法把它放在一边,并开始工作。

我无法理解这种奇怪的行为,但希望确保不会再被这种 b笑。 是否在<代码>ready后下载了包括档案在内的文件?

EDIT:

<script src="jquery.js" type="text/javascript"></script>
<script src="custom.js" type="text/javascript"></script>

$(function(){
    myCustomFunction(); ///THIS IS CAUSING EXCEPTION IN IE 8
});


$(document).ready(function(){
    myCustomFunction(); ///THIS IS WORKS IN IE 8
});
问题回答

只有在包括的所有档案都完成了下载之后,才可能发生火灾。

I also ran into a similar issue before, but it was due to my script tags not being closed properly, have a look here: How does $(document).ready() work in IE 8?

这些问题之所以可能,是因为JQuery尚未装满,试图在您的美元(文件)之前使用以下代码。 随时可加以测试的法典:

if (jQuery) alert( jquery loaded )
else alert( jquery not loaded )

We had a similar browser compatibility issue, can t remember if it was IE8. It was caused by the script tags type attribute.

我们有一些贴上标签的案文/javascript ( W3C建议), 申请/javascript , 还有一些字面没有特性。 JQuery位于标注案文/javascript的头顶,但最后装满。

这个问题很容易解决,把同样的内容提要放在所有文字标签上。





相关问题
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.

热门标签