[thelist] Passing global vars to an iframe

Simon MacDonald simonmacdonald at uk2.net
Tue Dec 1 11:36:01 CST 2009


Sorry replied to the wrong post previously :(

Global variables are assigned to the windows object so var aaa = null; is a
shortcut assignment for windows.aaa. The following code will list everything
in the windows object including variables. If you have a naming convention
you may be able to regex them out?

  <script type="text/javascript">  
		var aaa = null;
		var bbb = null;
		var globals = [];
		
		for (var n in window) {             
		  globals.push(n);
		}
		
		alert( globals.sort().join('  ') );   

  </script>

Not sure if this really helps, though. :)

Simon

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Barney Carroll
Sent: 01 December 2009 1:05 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Passing global vars to an iframe

The difficulty in this situation is that our content server for the ads is
effectively on a different domain. Cross-server scripting being what it is
that's not a goer for us.

Regards,
Barney Carroll

barney.carroll at gmail.com
07594 506 381


2009/12/1 Simon MacDonald <simonmacdonald at uk2.net>

> Barney,
>
> If I understand what you are trying to do ( and provided the parent and
> iframe document are in the same domain) you should be able to access the
> global variables in the parent with something like:
>
>         parent.document.variableName
>
> e.g.
>
>        // set the global variable 'foo' in the parent global scope
>        parent.document.foo = 'bar';
>
> Does this help?
>
> Regards
>
> Simon
>
>
> __________ Information from ESET Smart Security, version of virus
signature
> database 4650 (20091130) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 
 

__________ Information from ESET Smart Security, version of virus signature
database 4651 (20091201) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
 

__________ Information from ESET Smart Security, version of virus signature
database 4651 (20091201) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 




More information about the thelist mailing list