views:

43

answers:

1

Hi All ,

I need to parse JavaScript content , I am reading this content from a file now I need to identify the events associated with the JavaScript objects. Can someone tell me possible approach to achieve that.

Thanks in Advance.

Vinay

A: 

If you want to parse the contents of a JS file:

<script src="script.js" type="application/javascript"></script>

Or in Javascript:

var inject = document.createElement("script");
inject.type = "application/javascript";
inject.src = "script.js";
(document.body || document.documentElement).appendChild(inject);
Lekensteyn
I dont want to inject the JS file , I just want to parse it , so that i came to know which elements have events associated with them.
Vinay
You've asked a couple of questions on this subject. Step back and tell us what you really want. http://mywiki.wooledge.org/XyProblem
David Dorward