Click to See Complete Forum and Search --> : Pop Up Link Question


Baby Jai
07-13-2003, 04:42 PM
How can I create a link where it will pop up another window, smaller then normal with like rules or something in it.

David Harrison
07-13-2003, 04:56 PM
When you say rules, do you mean rulers as in cm and inches or something else.

Well if you do mean a ruler then you'll possibly need a couple of images to run down the sides and along the top.


To open a pop-up from a pop-up you can do this:

new_win = window.open(blah blah blah, all the usual stuff)

new_win.document.write('<script type="text/javascript"><!--');

new_win.document.write('function another_new_win(){')
new_win.document.write('new_win_2 = window.open(blah blah blah, all the usual stuff);}');

new_win.document.write('<a href="#" onclick="another_new_win();return false;">');

Baby Jai
07-13-2003, 05:00 PM
Im sorry I typed that quickly, this is what I mean. Sometimes when you go to a website on the bottom it will have a link set that says somethign like,

contact us | rules | email | terms

now when you click on those, it open in a window like 400x200, and this is one of there htmls. The problem Im having is I want to create something like that, but I dont know the code. Does anyone?

David Harrison
07-13-2003, 05:05 PM
function the_rules(){

rules = window.open("", "rules", "toolbar=no,status=no,width=400,height=200");
rules.document.write("<html><head><title>Rules</title></head><body><p>");
rules.document.write('Here are some rules:<br><ol>');
rules.document.write('<li>I am always right.</li>');
rules.document.write('<li>If I am wrong, see rule 1.</li></ol>');
rules.document.write("</p></body></html>");}

<a href="#" onclick="the_rules();return false;">View The Rules</a>

Baby Jai
07-13-2003, 05:20 PM
Ok, lol. Not necessarily rules. Lets just say I have 4 links that each of them are going to a seprate window. I got your script but you need to re-direct me in a easier way.

David Harrison
07-13-2003, 05:25 PM
OK, I think I get you now, you mean that you've already made the pages and you want to open them in a pop-up. If so do this:

<a href="#" onclick='window.open("rules.html", "", "toolbar=no,status=no,width=400,height=200");return false;'>View The Rules</a>

Baby Jai
07-13-2003, 05:28 PM
BANG! on the money! your the man

David Harrison
07-13-2003, 05:31 PM
*lets out a sigh of relief.

Thank God I got it (even if it was later rather than sooner).

Happy to help:)

Charles
07-14-2003, 05:31 AM
Originally posted by lavalamp
OK, I think I get you now, you mean that you've already made the pages and you want to open them in a pop-up. If so do this:

<a href="#" onclick='window.open("rules.html", "", "toolbar=no,status=no,width=400,height=200");return false;'>View The Rules</a> Here we go again. That will give you a link that does absolutely nothing for the 13% of people who do not use JavaScript. This is bad. And as that 13% includes some good people who cannot use JavaScript because of some disability it is very bad. Use instead:

<a href="rules.html" onclick='window.open("this.href", "", "width=400,height=200");return false;'>View The Rules</a>