Page problem

liunx

Guest
Hi guys,<br />
<br />
I don't know if this is a html problem or a javascript one, seems like a good a place as any to ask this.<br />
<br />
I will have on my main page a recent news bit, what I was wanting to do is have the "read more" links popup the news snippet in a new window (I can do this myself) but I'm having problems implimenting something properly.<br />
<br />
What I am wanting to do is allow users to click the page to close it, I have seen this on quite a few websites, but when I try it I keep getting a prompt asking me wether I want to let the window be closed. Is there a way around this? because it doesnt happen for other websites, so I need to know what I can do to stop it on mine.<br />
<br />
Cheers<!--content-->you need to open your window with javascript, just using target="_blank" wont do the trick. Open your 'read more' pop up with something like this:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" ONCLICK="open('moreNews.cfm','pop','toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=0,width=3 25,height=450');"><font size=1>Click here to read more...</font></a><br />
<br />
then INSIDE the pop up, all you have to do is put this link in to close it:<br />
<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onClick="self.close()">Close this window"</a><br />
<br />
<br />
Now, if you haven't opened the window with client side scripting (javascript here)... you'll get a prompt. However, if the web page has opened a window with client side scripting, the browser allows it to manipulate it, change location, and even close it.<!--content-->Right so basically the reason why it prompts me is because I didnt open it via javascript lol.<br />
<br />
Thats all I needed to know =]<br />
<br />
Cheers<!--content-->Oh, 1 more thing.......positioning of the popup??<!--content--><a href=http://www.htmlforums.com/archive/index.php/"#" ONCLICK="open('moreNews. cfm','pop','toolbar=0, location=0, directories=0, status=1, menubar=0, resizable=0, width=325, height=450, screenX=200, left=200, screenY=200, top=200')<br />
;"><font size=1>Click here to read more...</font></a><!--content-->Cheers =]<!--content-->
 
Back
Top