English 中文(简体)
你能举办一场以上的国内活动吗?
原标题:Can you have more than one domready event?

我对mootools有点陌生,但我知道在jQuery中可以有多个函数(在多个文件中):

$(document).ready(function() {
    // put all your jQuery goodness in here.
});

但是你能用mootools做一些类似的事情吗?

我的页面中已经有一个窗口.addEvent(“domready”,function(){,我真的不想更改那段代码,但我希望能够在标题中的单独文件中添加另一个domready函数。

这可能吗?还是我只能用另一种方式去做?

最佳回答

您可以有多个<code>window.addEvent(domready,function(){}),但在我看来,这有点违背了Mootools编写优雅代码的目的。

示例w/3 Domready

问题回答

暂无回答




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

热门标签