Link in pop-up

G

Gaffer

Hi

Can someone tell me how to put a link in a pop-up so that when it is clicked
the main page changes to that link? I am sure this can be done.

Thanks,
Gaffer
 
N

Neredbojias

Hi

Can someone tell me how to put a link in a pop-up so that when it is
clicked the main page changes to that link? I am sure this can be
done.

Popups indicate javascript, and javascript has an "opener" directive
available.
 
J

jim

I think this is what you're looking for:
==============================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script type="text/javascript" >
function doPop(){
// type in your button link href here:
var link = "http://www.google.com";
var new_win =
window.open('','newpop','width=650,height=200,left=60%,top=200,scrollbars=yes,status=yes,resizeable=yes' );
var text = "<html><body>";
text +="<button onClick=opener.location.href='" + link + "'>Link to
Google</button>";
text += "<button style='position:absolute; right:0px; bottom:0px;'
onClick='window.close()'>Close Window</button>";
new_win.document.write(text);
new_win.focus();
}
</script>
</head>
<body >
<button onClick="doPop()">Pop up</button>
</body>
</html>
 
G

Gaffer

jim said:
I think this is what you're looking for:
==============================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script type="text/javascript" >
function doPop(){
// type in your button link href here:
var link = "http://www.google.com";
var new_win =
window.open('','newpop','width=650,height=200,left=60%,top=200,scrollbars=yes,status=yes,resizeable=yes'
);
var text = "<html><body>";
text +="<button onClick=opener.location.href='" + link + "'>Link to
Google</button>";
text += "<button style='position:absolute; right:0px; bottom:0px;'
onClick='window.close()'>Close Window</button>";
new_win.document.write(text);
new_win.focus();
}
</script>
</head>
<body >
<button onClick="doPop()">Pop up</button>
</body>
</html>

Hi

That script gives me an error on page with IE. I'm not sure it's what I
want. I have a pop-up window which has a form on it to sign up to a
newsletter. So I want people to either sign up to it, or click a link that
says 'read more'. So when they click that link I don't want the pop-up
window to change, but the main page behind that, the full size page to
change. Is that possible?

Gaffer
 
J

JD

Gaffer said:
That script gives me an error on page with IE. I'm not sure it's what I
want. I have a pop-up window which has a form on it to sign up to a
newsletter. So I want people to either sign up to it, or click a link that
says 'read more'. So when they click that link I don't want the pop-up
window to change, but the main page behind that, the full size page to
change. Is that possible?

What does the visitor do then? Drag the popup out of the way so they can
read the page behind? That sounds annoying. It would make more sense to
have the form on the main page and then have the 'read more' content in
a popup, or better yet avoid the use of popups entirely.
 
G

Gaffer

JD said:
What does the visitor do then? Drag the popup out of the way so they can
read the page behind? That sounds annoying. It would make more sense to
have the form on the main page and then have the 'read more' content in a
popup, or better yet avoid the use of popups entirely.

They simple close the pop-up, it's only a tiny pop up (250px by 130px) so it
won't be a problem. It'd be cool if the 'more info' link changed the main
page to more info and closed the pop-up. In an ideal world that's what I
would like.

Gaffer
 
C

Chris F.A. Johnson

They simple close the pop-up,

Or leave the site.
it's only a tiny pop up (250px by 130px) so it won't be a problem.
It'd be cool if the 'more info' link changed the main page to more
info and closed the pop-up. In an ideal world that's what I would
like.

In an ideal world, there would be no pop-ups.
 
D

dorayme

"Chris F.A. Johnson said:
Or leave the site.


In an ideal world, there would be no pop-ups.

In an ideal world, the user would be able to have the form in a
pop up or on the page as best suits him or her. In fact,
sometimes, because there are not pop-ups provided, some users
make do with substitutes (sometimes a pain to organise) so they
can see two things at once on their big screens without scrolling
and remembering. If a website maker provides the facilities for
this where it is desired, this would better fit an ideal world.
But I suspect that a lot of people here have a darker notion of
an ideal world in which they have a conception of what users
should and should not desire. What can we call this last world?
"1984" has been taken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top