The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Close Window on click and open new window?
itzhyia
post Apr 15 2008, 09:41 AM
Post #1





Group: Members
Posts: 6
Joined: 12-April 08
Member No.: 5,433



I got this javascript and i want to close the current window when i click the link and open another window to load the website.....can i do that?


<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #000000;
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
-->

</style><center>









<script>
function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no,scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>


<p>&nbsp;</p>
<p>&nbsp;</p>
<center>
<p>&nbsp;</p>
<p><a href="java script:void(0);" onclick="PopupCenter('http://www.dawnguild.net/dawn.html', 'myPop1',1500,1199);"><img src="high_low_res.jpg" border="0" width="729" height="572" align="middle"
style="width: 800px; height: 800px; display: block; position: relative; top: 100px;"></a></p>
</center>

This post has been edited by itzhyia: Apr 15 2008, 09:43 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Apr 15 2008, 10:36 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,270
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(itzhyia @ Apr 15 2008, 07:41 AM) *
<a href="java script:void(0);" onclick="PopupCenter('http://www.dawnguild.net/dawn.html', 'myPop1',1500,1199);">
Please don't use javascript pseudo-URLs like that. Put a real URL in the href attribute, so the link will work when JavaScript is disabled/unavailable, like this:
CODE
<a href="http://www.dawnguild.net/dawn.html" onclick="PopupCenter('http://www.dawnguild.net/dawn.html', 'myPop1',1500,1199); return false">
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
shengja
post May 13 2008, 11:52 PM
Post #3





Group: Members
Posts: 5
Joined: 6-May 08
Member No.: 5,587



<script>
window.open("testpage.html","win")
window.close()
</script>

That will work.

_______________________________
brochure printing
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th June 2018 - 02:34 AM