| | |
Parent/Child Windows References
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
I have the same problem, and I can't achieve to serialize my popup reference.
I tried with JSON and a lot of different libraries :
var popupVar = window.open('url', 'name');
var serializedString = JSON.encode(popupVar);
var serializedString = popupVar.toJSONString();
...
Every time I have errors. I could catch it with IE, and it says : [Object error]. Great :p
In Firefox it just crashs it...
I did'nt find any real example on serializing JS "native" objects, only JS "created" objects (like var Person = { this.id; this.name; })
Does someone achieve it ? Know how to serialize this popupVar ?
Thanks a lot
I have the exact same java script issue where even if my parent window reloads, it should still be able to hold the child window references. Did you manage to get a solution for that. Any help would be appreciated.
Thanks in Advance.
> even if my parent window reloads, it should still be able to hold the child window
> references.
AFAIK, you simply can't. To put it in simple terms, the Javascript variables disappear after a page reload. After all Javascript is a client side technology.
A work around would be to store all the information you need to maintain inside a cookie i.e. whether the child window was open or not and if yes then what were it's contents; at the same time being aware of the 4KB limit imposed on the cookie size.
> references.
AFAIK, you simply can't. To put it in simple terms, the Javascript variables disappear after a page reload. After all Javascript is a client side technology.
A work around would be to store all the information you need to maintain inside a cookie i.e. whether the child window was open or not and if yes then what were it's contents; at the same time being aware of the 4KB limit imposed on the cookie size.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
•
•
•
•
> even if my parent window reloads, it should still be able to hold the child window
> references.
AFAIK, you simply can't. To put it in simple terms, the Javascript variables disappear after a page reload. After all Javascript is a client side technology.
A work around would be to store all the information you need to maintain inside a cookie i.e. whether the child window was open or not and if yes then what were it's contents; at the same time being aware of the 4KB limit imposed on the cookie size.
However, if you could persist the current window to the next reload in the browser, you could also persist reference to open windows, and other objects (dependents).
Unfortunately I cannot release the code for this right now, as I would like to, as we have a patent pending. I will try and get this code out in ASAP as I know this is needed in many areas of web development, especially the web2.0.
As soon as we get the patent sorted you will be able to persist references to host objects in javascript between the loading of new windows.
At the moment I am interested in any other methods that may have been discovered to do this, though I have not found any so far.
-- update:
I'll add some code to demonstrate persistence of javascript native and host objects after I get it tested in a majority of browsers and OS's.
Last edited by digital-ether; Mar 22nd, 2008 at 12:19 pm.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
•
•
•
•
You can't store a popup window reference in a cookie as it is directly dependent on the current parent window/document which is a javascript host object.
However, if you could persist the current window to the next reload in the browser, you could also persist reference to open windows, and other objects (dependents).
You could store information like the child windows' attributes like its height, width, position etc. in a cookie. On a document load, your javascript function would then check the contents of the cookies and then re-create a child window based on the flag 'recreateNeeded' which would be either true or false or 0 or 1 (the way you want it to be). Of course this means persisting the child window information at regular intervals and writing a custom mini parser which would parse the contents of the cookie at load time but yes, it's very much possible with a bit of effort .
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- Parent/Child Windows (JavaScript / DHTML / AJAX)
- how can I fix two child windows in a mdi form in vb 4 (Visual Basic 4 / 5 / 6)
- ASP.NET 2.0, Parent/Child Data Control? (ASP.NET)
- Displaying a different bitmap in different child windows? - win32 in C (C)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Help with <label for = idref[CS]>
- Next Thread: LogicWeb AJAX
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captchaformproblem checkbox child class close codes date debugger dependent developer disablefirebug dom editor element embed engine events explorer ext file firefox flash form forms game gears getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl maps marquee masterpage math matrixcaptcha media mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming rated redirect runtime safari scriptlets scroll search security session shopping size software solutions star stars stretch synchronous toggle tweet unicode variables web webkit webservice window wysiwyg \n






