When the page loads, i want a popup to come asking if i want to set the page as a homepage. i know this is annying, but i am doing it for a javascript section in my website. Please help.
As far as your popup is concerned, have a look at this: [code=php] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> function openwin() { var wintitle = "popup"; // popup title var width = "400"; // popup width var height = "250"; // popup height LeftPosition = (screen.width) ? (screen.width-width)/2 : 0; TopPosition = (screen.height) ? (screen.height-height)/2 : 0; windowproperties = 'height='+height+',width='+width+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no'; newwin = window.open('', wintitle, windowproperties); newwin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>'+wintitle+'</title></head><body><center>Put your link for setting your page as the homepage of the user here...<br><br><a href="javascript:window.close();" title=" Close this window... ">click here to close window</a></center></body></html>'); } </script> </head> <body onload="openwin()"> Your page's content...</body> </html> [/code] Cheers - Pit
This is how i wanted it to be. I want it so that as the page loads, an alert box asking to set the homepage to this site. The link u have given me shows me how to set the homepage using a link (which i already know how to use). Now, using this code, i want it so that, immediately after the page loads, this come up automatically.
@PittimannDec 03.2003 — #Sorry - but you've asked for a popup and I gave you one! You didn't ask for an alert and plus: a simple "alert box" is not able to give the user any choice. It just contains an OK button.
Seems you misunderstood my code - if you don't want a popup window you need a "confirm box".
If you told me what you actually want I'll post another code here, but the one I already posted should be sufficient for you.
In the document.write of the function, you just have to replace the sentence "Put your link for setting your page as the homepage of the user here..." with your link.
I just put the link at the beginning of my last post, INCASE you do not know, how to accomplish that part...
@aommasterauthorDec 03.2003 — #Now u have understood me. U r talking about exactly what i wanted.
Actually, i know that it is quite an easy way to set as a homepage, but i just wanted it for the knowledge. I just wanted it so that i could see how poeple actually do it.
Do u actually know how to do it? Just out of curiosity.
@aommasterauthorDec 04.2003 — #Thanx alot. Actually, to be honest, i also hate this sort of stuff. I actually just did it for the knowledge. Thanx alot again.