•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,606 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,612 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 279 | Replies: 0
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi all,
I'm just wondering..... Is there any way to know what variables are associated to a given kind of data type or class (when using prototype for example)?
Let me explain.
if I have:
// javascript:
var myVar = new Array();
var myObj = new CustomPrototypeClass();
So, in some way I want to do something like:
alert(myVar.variableName())
that shows:
myVar
or
alert(myObj.variableName);
will show
myObj
what I need to do is reference a variable inside another code depending on the type of object I'm manipulating. I'm getting that effect including the name of the variable as a parameter to my custom class, like:
var myObj = new CustomObject(param1, param2, "myObj");
But it looks too freaking weird!!!!!!
Is there any other elegant way to achieve what I want? any Ideas? I think I'm good at JS but I can't figure it out.
thanks in advance.
Alex
I'm just wondering..... Is there any way to know what variables are associated to a given kind of data type or class (when using prototype for example)?
Let me explain.
if I have:
// javascript:
var myVar = new Array();
var myObj = new CustomPrototypeClass();
So, in some way I want to do something like:
alert(myVar.variableName())
that shows:
myVar
or
alert(myObj.variableName);
will show
myObj
what I need to do is reference a variable inside another code depending on the type of object I'm manipulating. I'm getting that effect including the name of the variable as a parameter to my custom class, like:
var myObj = new CustomObject(param1, param2, "myObj");
But it looks too freaking weird!!!!!!
Is there any other elegant way to achieve what I want? any Ideas? I think I'm good at JS but I can't figure it out.
thanks in advance.
Alex
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: javascript:floating images forces browser window to expand
- Next Thread: css internet explorer 6 firefox


Linear Mode