Solved

userData persistence in new Window

Posted on 2004-04-14
4
566 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
ID: 10826526
var obj = window.opener.oSharedData;

obj.load("XMLSharedData");

--Lisa
0
 
LVL 3

Expert Comment

by:ljfernandez
ID: 10826726
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
ID: 10826746
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
ID: 10826829
Thanks much.  Worked like a charm!!!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jqury 17 30
where is team.js? 3 25
Checkout Page Input Field not aligned 1 22
Hide cell in a table 2 12
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

770 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