English 中文(简体)
理解 j 初创
原标题:Understanding jQuery initialization

当文件装入客户浏览器时,就很明显了。

$(function(){
some code here
});

接管。

Say I有两份 Java本文件main.js e.js

main.js是功能性的,e.js是页数时某些假设的打字。 我想这两份文件。 我在index.html>上加入。 两者都始于:

$(function(){
    some code here
    });

我的问题是,执行<代码>文件.ready的次序是什么? 页: 1 完成了它应当做的工作:main.js。 接管?

最佳回答

我们可以有多个<代码>文件.ready,但这影响到该代码的可读性。 详情见here

问题回答

It is sequential. There is no parallel processing in javascript. They will be called in the order you included your scripts on the page.

这也是一个很好的答案:。 您有多美元(文件)阅读(功能(功能){......});各节?

贾瓦伦古斯塔尔在违约时同时执行该守则;在你需要创建webworkers的背景下执行该守则。 目前,你们的法典首先发挥作用。





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

热门标签