userData persistence in new Window

I am using the userData persistence to save information on the client.  Everything is working fine saving and loading values as long as I use the same window.  However, I would like to open a new (child) window and get a value from the userData store in the child window:

function test(){
      oSharedData.load("XMLSharedData");
      alert(oSharedData.getAttribute("txtSysNme"));
}

My child window has the .userData style element specified and a DIV element with userData class (ID=oSharedData).  I still am not able to use getAttribute from this new window.  Does anybody have any ideas????

codeguy
codeguyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ljfernandezConnect With a Mentor Commented:
var obj = window.opener.oSharedData;

obj.load("XMLSharedData");

--Lisa
0
 
ljfernandezCommented:
Sorry, read the question wrong.

First name the window you are opening:

var newwin = window.open("url here...");
Then:

var obj = newwin.document.all.oSharedData;

obj.load("XMLSharedData");

--Lisa
0
 
ljfernandezCommented:
The second part:

var obj = newwin.document.all.oSharedData;

obj.load("XMLSharedData");

Is in the parent and refers to the div with the userdata class in the child.

--Lisa
0
 
codeguyAuthor Commented:
Thanks much.  Worked like a charm!!!
0
All Courses

From novice to tech pro — start learning today.