Solved

userData persistence in new Window

Posted on 2004-04-14
4
564 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:codeguy
  • 3
4 Comments
 
LVL 3

Accepted Solution

by:
ljfernandez earned 250 total points
Comment Utility
var obj = window.opener.oSharedData;

obj.load("XMLSharedData");

--Lisa
0
 
LVL 3

Expert Comment

by:ljfernandez
Comment Utility
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
 
LVL 3

Expert Comment

by:ljfernandez
Comment Utility
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
 

Author Comment

by:codeguy
Comment Utility
Thanks much.  Worked like a charm!!!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now