• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

how to pass value to child window

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to pass an xml string from parent window to child window.

My restrictions
1. It is a window.open and not a modalDialog, so i cannot pass arguments
2. I cannot use querystring due to security issues.

Can anybody tell me a way to achieve this.

xml is of the format <NODE CODE="somecode" VALUE="somevalue" />

I tried to do this as below but it failed

handle = window.open("mypage.aspx");
var objHdn = handle.document.createElement("INPUT");
objHdn.type = "hidden";
objHdn.id = "hdnXenon";
objHdn.value = g_XenonXml;


another way I tried was:
handle.document.write("<script language=javascript>var xml="+xml+"</script>");

but when I did view source, the above script statement had overwritten everything else in mypage.aspx
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a blog on this awhile back here: http://radio.javaranch.com/pascarello/2005/01/18/1106063002000.html

Eric
 
Ashutosh Uprety
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works! I had tried the similar way, but missed the setTimeout funda.

Thanks !
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't actually tried it myself, but it's also supposed to be possible to open an empty window with window.open and then submit a form to it, right? That would allow you to submit data to a serverside script using POST.

-Yuriy
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is as simple as:



Eric
[ March 22, 2005: Message edited by: Eric Pascarello ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic