Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-23-2002, 06:53 PM   PM User | #1
Turek
New to the CF scene

 
Join Date: Jul 2002
Location: Poland
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Turek is an unknown quantity at this point
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
Turek is offline   Reply With Quote
Old 07-23-2002, 07:21 PM   PM User | #2
ACJavascript
Regular Coder

 
Join Date: Jun 2002
Location: FL, USA
Posts: 734
Thanks: 0
Thanked 0 Times in 0 Posts
ACJavascript is on a distinguished road
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
ACJavascript is offline   Reply With Quote
Old 07-23-2002, 07:45 PM   PM User | #3
Turek
New to the CF scene

 
Join Date: Jul 2002
Location: Poland
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Turek is an unknown quantity at this point
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 07:48 PM..
Turek is offline   Reply With Quote
Old 07-23-2002, 07:54 PM   PM User | #4
adios
Senior Coder

 
Join Date: Jun 2002
Posts: 1,404
Thanks: 2
Thanked 32 Times in 32 Posts
adios is on a distinguished road
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()?
adios is offline   Reply With Quote
Old 07-23-2002, 08:22 PM   PM User | #5
Turek
New to the CF scene

 
Join Date: Jul 2002
Location: Poland
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Turek is an unknown quantity at this point
=> 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 08:24 PM..
Turek is offline   Reply With Quote
Old 07-25-2002, 11:02 PM   PM User | #6
Turek
New to the CF scene

 
Join Date: Jul 2002
Location: Poland
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Turek is an unknown quantity at this point
seems noone is answering agaiin :(

.
Turek is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:02 AM.


Advertisement
Log in to turn off these ads.