473,762 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to get a list of available JavaScript functions/methods

Hi all,
I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically. I'm not fussy about what language I
use, be it JavaScript or something else. Anyone got any ideas? I've
tried Exuberant Ctags, but that does not seem to work on very advanced
scripts like Ext.

I'm guessing the best way would be to have some kind of interrogation
of a HTMLScriptEleme nt or something, but I can't see how to get a
simple list of functions/methods from that.

Alternatively, any C library for parsing JS might be a good idea, even
Python, Perl, PHP, whatever really, anyone got any recommendations ?

Cheers

Garry
Jun 27 '08 #1
12 10896
thegman wrote:
I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically.
You are about the 1337th person to ask that question here. Care to do
a *little* research before you bother other people with your problems?

http://jibbering.com/faq/
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 27 '08 #2
On May 10, 3:30*pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
thegman wrote:
I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically.

You are about the 1337th person to ask that question here. *Care to do
a *little* research before you bother other people with your problems?

http://jibbering.com/faq/

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

I've looked around quite a lot, maybe I'm the worst Googler in the
world or something, but I can't find what I'm looking for, if
someone's got some links, I'd appreciate it.

Thanks

Garry
Jun 27 '08 #3
thegman wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>thegman wrote:
>>I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically.
You are about the 1337th person to ask that question here. Care to do
a *little* research before you bother other people with your problems?

http://jibbering.com/faq/
[...]
Please trim your quotes as also recommended by the FAQ Notes.
I've looked around quite a lot, maybe I'm the worst Googler in the
world or something, but I can't find what I'm looking for, if
someone's got some links, I'd appreciate it.
http://groups.google.com/groups?as_u...ing=d&filter=0
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Jun 27 '08 #4
VK
On May 10, 6:14 pm, thegman <taylor.ga...@g mail.comwrote:
I'm trying to get list of JavaScript methods/functions in a script
1) Top level functions only or all functions together, including
anonymous and nested ones? The latter one is pretty much impossible w/
o operating on a lower level via XPCOM/C (Gecko) or C++ (IE) - just to
let you know in advance.

2) Custom functions only or everything? Say setTimeout should be in
your list or now?

3) For the running script or for the script source treated as plain
text?

With these questions answered the rest should be rather easy.
Jun 27 '08 #5
On May 10, 9:25*pm, VK <schools_r...@y ahoo.comwrote:
On May 10, 6:14 pm, thegman <taylor.ga...@g mail.comwrote:
I'm trying to get list of JavaScript methods/functions in a script

1) Top level functions only or all functions together, including
anonymous and nested ones? The latter one is pretty much impossible w/
o operating on a lower level via XPCOM/C (Gecko) or C++ (IE) - just to
let you know in advance.
All functions, but particularly functions/methods defined in third-
party scripts such as Ext.
>
2) Custom functions only or everything? Say setTimeout should be in
your list or now?
Would be good to have setTimeout and other builtins, but not
essential.
>
3) For the running script or for the script source treated as plain
text?
Not fussy, I don't mind doing this with JavaScript, or pretty much any
other language.
>
With these questions answered the rest should be rather easy.
Thanks for the reply, I've been looking at this most of the day, and
not come up with any bulletproof solutions yet.

Cheers!

Garry

Jun 27 '08 #6
VK
I'm trying to get list of JavaScript methods/functions in a script
>
1) Top level functions only or all functions together, including
anonymous and nested ones? The latter one is pretty much
impossible w/o operating on a lower level via XPCOM/C (Gecko) or
C++ (IE) - just to let you know in advance.

All functions, but particularly functions/methods defined in third-
party scripts such as Ext.
What is your level of programming experience? In the particular how
would you define "all anonymous functions"? All named references to a
function or the initial reference only? If you don't understand the
question I can try to rephrase it with a sample.
2) Custom functions only or everything? Say setTimeout should be
in your list or not?

Would be good to have setTimeout and other builtins, but not
essential.
'k

3) For the running script or for the script source treated
as plain text?
Not fussy, I don't mind doing this with JavaScript,
or pretty much any other language.
You didn't understand me. My question was: do you want to study a
running code for method references - or you want to parse some text
say library.js to find all occurrences of "function" string in it and
regexp with it?

Jun 27 '08 #7
In comp.lang.javas cript message <48************ **@PointedEars. de>, Sat,
10 May 2008 16:30:11, Thomas 'PointedEars' Lahn <Po*********@we b.de>
posted:
>thegman wrote:
>I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically.

You are about the 1337th person to ask that question here. Care to do
a *little* research before you bother other people with your problems?

http://jibbering.com/faq/
If you had intended to be helpful, you would have given the number of
the relevant section. There is no section which, to the intended
audience, will appear helpful. The OP will realise that, whatever your
intent, your main effect when replying to newcomers is to demonstrate
how obnoxious you are.

--
(c) John Stockton, nr London UK. ??*@merlyn.demo n.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demo n.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jun 27 '08 #8
On May 10, 10:52*pm, VK <schools_r...@y ahoo.comwrote:
I'm trying to get list of JavaScript methods/functions in a script
1) Top level functions only or all functions together, including
anonymous and nested ones? The latter one is pretty much
impossible w/o operating on a lower level via XPCOM/C (Gecko) or
C++ (IE) - just to let you know in advance.
All functions, but particularly functions/methods defined in third-
party scripts such as Ext.

What is your level of programming experience? In the particular how
would you define "all anonymous functions"? All named references to a
function or the initial reference only? If you don't understand the
question I can try to rephrase it with a sample.
My programming experience is longer than I care to remember, but not
JS, not even slightly, which is probably not helping my cause much. I
guess any function/method which is usable, I'd like to list that.

>
You didn't understand me. My question was: do you want to study a
running code for method references - or you want to parse some text
say library.js to find all occurrences of "function" string in it and
regexp with it?
I understand your question, it's just that I'm not bothered which way
I end up doing this, I can use JavaScript in a running browser, and
capture the output, or indeed run some kind of regex thing and get the
results that way, I'm relatively indifferent about how I get this
done, just so long as it works. My first thought was to use something
like ctags, or maybe a Python parser, but I could not find anything
which was much good. My thoughts then turned to using the DOM tree or
something like that, which I'd expect to be a bit more robust, after
all, what understand JS better than a browser?

Thanks

Garry
Jun 27 '08 #9
[snipped attribution novel]

Dr J R Stockton wrote:
Thomas 'PointedEars' Lahn posted:
>thegman wrote:
>>I'm trying to get list of JavaScript methods/functions in a script
file in much the same a good text editor will, the difference being
that I need to output it to a file or stdout, or some other way of
"getting at it" automatically.
You are about the 1337th person to ask that question here. Care to do
a *little* research before you bother other people with your problems?

http://jibbering.com/faq/

If you had intended to be helpful, you would have given the number of
the relevant section. There is no section which, to the intended
audience, will appear helpful. [snipped flame]
The relevant section is the one describing where the newsgroup's archives are.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1739
by: nnes | last post by:
I have really no mayor gripes, and the few things I would change would break backward compatibility, but here is the list anyway: 1.) Eliminate the whole long stuff. E.g. built-in long () function, "L", etc. It is a Python language implementation detail and I do not care about how it is done as long as it is fast and correct. Make python int adapt according to size of the integer and underlying architecture. 8088-80286=16 bit integers,...
4
9596
by: ÂÑTØÑ | last post by:
Hi, I was looking for a list of commands, but I can't find it. It's about commands you can type in the Internet Explorer adress bar, to get some information about a website. For instance "javascript:alert(document.lastmodified)" to find out when the website was updated. Can someone help me out? Thanx in advance,
8
2092
by: Rich Grise | last post by:
I think I've finally found a tutorial that can get me started: http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html and I've been lurking for awhile as well. What happened is, I've been playing with Qt in KDE on a Slackware 10.0 system, and following their cookbook exercises, and everything's working, and I have no clue what the code is doing, i.e.. how do I connect my brain to the ascii in the files to the stuff on...
1
2918
by: John | last post by:
Hi, we have the following problem: in our application v1.0 we have static html pages (+ some javascript). With a CMS (a Content Management System) some "mortal" people can add or expand the available images for the start site. The site loads randomly an image or a Flash animation (if the flash plugin is present) through a javascript and each time the start site loades and displays only 1 different picture. At the moment the name of...
4
4672
by: Pasquale | last post by:
Hello, I wondering if there is a way to dynamically update a select list with javascript from a database query without having to reload the page to update the list?
35
3614
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is to management theses :-((( I must to declare and use all variable with this scheme :
4
1759
by: UJ | last post by:
I have a long list of items that the user will be able to select from. When they select an item, I'd like to have more detailed information appear on the right side of the screen. I've already got a datagrid set up with the clicking working correctly. Problem is, I'd like to have the list be scrollable but leave the info on the right alone. What can I put around the datagrid so that the entire thing becomes scrollable? TIA - Jeff.
16
13609
by: Brian D | last post by:
I have a multiple select list that is created dynamically based on a previous selection on an asp page. The first thing I do is to clear the curent option list by document.form1.itemcross.length = 0; The only problem is that it leaves the optgroups. How do I also get rid of the optgroups? Thanks
8
1742
by: Daz | last post by:
Hi everyone. I just wanted to know if there was any way to use script to display a list of methods linked to a particular object? The object I have in mind is getBrowser(), and I can't seem to find any documentation online with regards to it's methods. Also, as I am learning, it would be nice to be able to know what methods are available for a particular object/function, without necessarily having to spend a while looking up an...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5268
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3914
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.