Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Poland
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Popup window location

    hi, i have such a script for example:
    Code:
        function popup(redirection) {
          winpopup=window.open("","winpopup","scrollbars,status=1")
          winpopup.moveTo(50,50)
          winpopup.resizeTo(790,400)
          winpopup.location=redirection
        }
    and now is the problem to make, for example button onthe first page, and when i click on it an alert box apears with the url of the popup window...
    i tried something like that:
    Code:
    alert(winpopup.location.href);
    and
    Code:
    alert(winpopup.location);
    and
    Code:
    alert(winpopup.document.location);
    but always with an error..

    any ideas why, or what i've done wrong??
    thanks for replies

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try this

    -----

    <script language="javascript">

    function popup(redirection) {
    alert(redirection)
    winpopup=window.open(redirection,"winpopup","scrollbars,status=1")
    winpopup.moveTo(50,50)
    winpopup.resizeTo(790,400)
    }

    </script>

    ----


    <input type="button" value="go" onclick="popup('http://www.codingforums.com')">




    This what ya ment
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Poland
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes true, but i've not expected this... i should say it that way: popup opens with a page, when you click on button, and that page redirects somewhere, and now back to the first page, i click on button and it alerts me what link/url is now in that popup window.... just want to make script that tells me what url is currently in popup window...
    Last edited by Turek; 07-23-2002 at 08:48 PM.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Is the redirected file in the same domain as the page which opens it? What's the error message? How are you triggering the alert()?

  • #5
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Poland
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    => Is the redirected file in the same domain as the page which opens it?
    nope
    => What's the error message?
    it says in the status, script error
    => How are you triggering the alert()?
    <script language="javascript">
    ...
    function checkp() {
    window.self.status = winpopup.location.href;
    }
    ...
    </script>
    <input name=turek onclick=checkp(); type=button value=value>

    OK i want to make something like that: the user enter my page there are two buttons: VOTE and ENTER, user click VOTE, the popup opens where he can vote, whith button inside, and now the script on first page should check if he clicked that button in popup window (check if popup window has url that is visited after clicking). after that ENTER button enables... i know how to do the rest of this, but i only need something that will check what url is now in popup window...
    Last edited by Turek; 07-23-2002 at 09:24 PM.

  • #6
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Poland
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    seems noone is answering agaiin :(

    .


  •  

    Posting Permissions

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