SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    popup and passing variables

    How is it possible to open a popup with javascripts and pass javascript variables in the forum popup.html?var1=blah&var2=blah

    Thanks in advance to anyone that can help
    Professional PHP programing / Hosting
    aim: downtoi3iz icq: 74637813

  2. #2
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another small question how do i set a form field equal to a javascript variable.
    Professional PHP programing / Hosting
    aim: downtoi3iz icq: 74637813

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wrote a javascript class for passing data via the query-string. I keep a live demo page here (I tested it with your data)

    Of course, you don't really need to "pass" the data. You can access any variable in the opener windows from the opened window.

    alert( window.opener.var1 ); // assumes var1 is global in the opener
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so if i make a popup I can go mainwindow.fram[a].document.title?
    Professional PHP programing / Hosting
    aim: downtoi3iz icq: 74637813

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not exactly, but you CAN get a reference to the opening window by using

    window.opener

    from the popup. Is your opener window a frameset?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes
    Professional PHP programing / Hosting
    aim: downtoi3iz icq: 74637813


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
  •