SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict jasongr's Avatar
    Join Date
    Jul 2004
    Location
    usa
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to pass a large info to a page via window.open

    Hello

    I would like to open a new window using window.open()
    I need to be able to pass a large serialized object to that object. The serialized content is generated by PHP.
    The serialized object is represented as a long string that I would like to pass to the new window.
    It cannot be part of the URL, since the string can be very long (more than 255 characters).
    Is there a way to pass such info to the window?

    I am using IE 5.5

    thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Netherlands
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you add some more info, what generated the serialized object for instance. Because the max length of a string you can add to an URL (in IE) is approx. 1,708 characters, so if it exceeds this, it won't work.

  3. #3
    SitePoint Addict jasongr's Avatar
    Join Date
    Jul 2004
    Location
    usa
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the serialized object is generated by PHP which serialized one of my own custom objects. The length of the object is potentially very long and could easily exceed the maximum allowed URL length

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Netherlands
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess the only solution is then to store this object on the server and append a reference (id of some sort) to the querystring and retrieve the object from the server again on the new document.

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepoint.com/blog-post-view.php?id=165367

    Haven't had time to read this but, looks promising...

    You can dynamically pass data, after load, as well.
    ::: certified wild guess :::

  6. #6
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you could put the data in some hidden object on parent page and instruct the popup to grab data on its own:

    Code:
    // main window
    
    <textarea style='display:none' id="uID">
    your data
    </textarea>
    ....
    <script>
    w=window.open("popup.html?id=uID"...
    
    // in popup
    
    onload = function()
       uID = location.search.match(/id=(\w+)/)[1]
       bigData = window.opener.document.getElementById(uID).value;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •