WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Strange JavaScript Question

 
   Home -> Office other -> Programming RSS
Next:  Database Interface Wizard-No Database editor page..  
Author Message
Mike McCollister

External


Since: Jun 20, 2008
Posts: 3



(Msg. 1) Posted: Fri Jun 27, 2008 6:19 pm
Post subject: Strange JavaScript Question
Archived from groups: microsoft>public>frontpage>programming (more info?)

I am trying to do what is most likely impossible. In JavaScript I want to
know the variable name that a new object is assigned to from within the
object. For example, if I do this

var testObject = new TestObject();

then the TestObject object will, with some magic function, get the
assignment variable name which in the above case is "testObject". I'm
thinking that the caller or callee property might be of use.

function TestObject()
{
// constructor
{
// constructor stuff here
var html = "";

var assignmentName = SomeMagicFunction(); // ??? where's the magic

html += "<img onClick='" + assignmentName + ".DoThisFunction()'>";

document.writeln(html);
}
}

If this is impossible, I'll just pass the assignee name as a parameter to
the object. Just wanting to make the object as smart as possible.

Thanks,

Mike
Back to top
Login to vote
Steve Easton

External


Since: Oct 15, 2003
Posts: 8666



(Msg. 2) Posted: Fri Jun 27, 2008 8:56 pm
Post subject: Re: Strange JavaScript Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ok, exactly what are you trying to do when you click on an image?
Open it in a new page or window?

If so, take a look at the source in this page that I forgot was still on my server until just now:
http://www.95isalive.com/test/

You'll need to allow pop ups if you want to see what it does.

--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm



"Mike McCollister" <MikeMcCollister_DELETEME_.DeleteThis@hotmail.com> wrote in message
news:150B72BD-2DBB-4147-BB20-1A9C8A6AEEAB@microsoft.com...
>I am trying to do what is most likely impossible. In JavaScript I want to know the variable name that a new
>object is assigned to from within the object. For example, if I do this
>
> var testObject = new TestObject();
>
> then the TestObject object will, with some magic function, get the assignment variable name which in the
> above case is "testObject". I'm thinking that the caller or callee property might be of use.
>
> function TestObject()
> {
> // constructor
> {
> // constructor stuff here
> var html = "";
>
> var assignmentName = SomeMagicFunction(); // ??? where's the magic
>
> html += "<img onClick='" + assignmentName + ".DoThisFunction()'>";
>
> document.writeln(html);
> }
> }
>
> If this is impossible, I'll just pass the assignee name as a parameter to the object. Just wanting to make
> the object as smart as possible.
>
> Thanks,
>
> Mike
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Programming All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET