473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Displaying Javascript Environment, functions and Variables

I want to display all the variables and functions availiable to a web page.
I used to have a JavaScript that did this but are unable to get it at the
moment, could someone post such a script please.

Aaron
Jul 23 '05 #1
3 1395


Aaron Gray wrote:
I want to display all the variables and functions availiable to a web page.
I used to have a JavaScript that did this but are unable to get it at the
moment, could someone post such a script please.


You can enumerate the properties and methods of an object, for instance
the window object
var text = '';
for (var property in window) {
text += property + ': ' + (typeof window[property] + '; ';
}
alert(text);
But it depends on the browser whether host methods like resizeTo are
exposed to the for .. in enuemration.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
> You can enumerate the properties and methods of an object, for instance
the window object
var text = '';
for (var property in window) {
text += property + ': ' + (typeof window[property] + '; ';
}
alert(text);
But it depends on the browser whether host methods like resizeTo are
exposed to the for .. in enuemration.


Thanks, that's a good start,

Aaron
Jul 23 '05 #3
Aaron Gray wrote:
I want to display all the variables and functions availiable to a web
page. I used to have a JavaScript that did this but are unable to get
it at the moment, could someone post such a script please.


Try <http://pointedears.de/ObjectInspector> (or
<http://pointedears.ml-webhosting.de/ObjectInspector>).

But note that since I am using my own script libraries to realize the
app, many items that are displayed are not built-in but defined in the
libraries; I have not found a way to workaround that effectively yet,
suggestions are welcome. Sometimes you can distinguish between built-in
and library properties anyway since the former are often not enumerable
and so have the icon for the DontEnum flag displayed, and their value
contains specific substrings like "[native code]".
HTH

PointedEars
--
I ate your Web page. Forgive me; it was tasty And tart on my tongue
Jul 23 '05 #4

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

Similar topics

3
by: Jim Potts | last post by:
What is the best way in Python version 2.x to read/get Windows (nt/2000/xp) system and user environment variables? Thanks for the help! jep
10
by: Andy Fish | last post by:
Hi, can anybody put forward a sensible argument javascript's behaviour of creating a new global variable whenever I assign to a previously undeclared variable. I can't beleive this is just for...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
1
by: jarit | last post by:
Hi, Found these coding guidelines for C#, HTML, Javascript, Java, HTML, PL/SQL, T-SQL, VB and VBScript. Well written and free to download. www.demachina.com/products/swat Jeroen
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
26
by: learner | last post by:
Hi, What is the difference between accessing environment variables through int main(int argc,char *argv,char *envp) and extern char **environ;
4
by: James Pemberton | last post by:
I have recently created a ASP site utilizing Master Pages and all works fine until I want to proces my javascripts. Just to let you know, most of cliewnt side scripting is new to me. But...
1
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
76
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.