English 中文(简体)
How to check if mootools.js is actually being used within a web site?
原标题:

I inherited a web site project that includes mootools.js (about 40k) in most of the scripts. However, I have not seen, intuitively, where it is being used and given the nature of this porject, ahem, I m thinking it might not be being used at all!

I m "under the gun" to ship this tonight (yup, it s a pre-Thanksgiving release). I have not used mootools.js so I m not sure what to grep for or if there s a sure tell way to determine this. I don t want to have to JSLint it (or do I LOL). Any suggestions would be appreciated. Thanks.

最佳回答

Mootools grafts itself onto some of the native js stuff, so it might be hard to do just by code inspection unless you are very familiar with what MooTools gives you.

Remove it, run your automated tests.

Cause you have those, right?...

问题回答

Remove it and see if anyone complains.

(You could try it on a test machine first, if you re not feeling brave.)

You must have a dev version of the site. Just pull it out and go over pages see if stuff breaks. Mostly you will get unknown function type stuff, if there is any dependencies. Firebug is your friend.

1, Open firebug 2, Click the DOM tab 3, Check if the Mootools object exists (It will say the current version of mootools next to it). Hope this helps :)

You can check your source code on some MooTools methods, for example, addEvent(). If it is used so here is the Mootols :)

Just check from the home page of http://mootools.net/

I also was interested on one site why they use jquery and mootools. So, I found addEvent() method. It is Mootols method.





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

热门标签