开发者

How to find where prototype is being used?

We have 600 jsp files and I need to find out where we are using prototype.

Is searching for "$(" the best way to do this?

Will it catch all instances o开发者_StackOverflowf searching for where prototype is being used? (If not, please provide what you would search for)


$ is a good start, but depending on the programmer's style, they may be doing things like:

Element.hide('someDiv')

...which is another format to do the same thing. Finding $ will only help you find DOM manipulation functions, but there are plenty of other things Prototype.js can do, such as Ajax:

new Ajax.Request(....

Now if I do something like this, there are parts of it that are based on Prototype but simply looking for $ is not the answer:

var myDiv = $('someDiv') <-- obvious
myDiv.down('active').show()  <-- not obvious

or how about:

this.select('.someClass')

...all of these use Prototype. So in a nutshell, you need to know what the code is doing, as well as what parts of the code use Prototype.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜