- Forums
- Javascipt
- Javscript How To Make Link With New Browser Popup Window HTML Code Script
This Page Contains information about Javscript How To Make Link With New Browser Popup Window HTML Code Script By edwino85 in category Javascipt with 1 Replies. [790], Last Updated: Sat May 18, 2024
edwino85
Tue Mar 06, 2007
1 Comments
4689 Visits
if you wan to create a link where when clicked on, a brwoswer popup window will show when your visitors click on it with a specific demensions thatn this is your tutorial.
Thanks to the support team at www.webune.com for their support on this question
you will need to do two things,
1. firs put this code in between the <head> </head> tags in your HTML pages.
CODE:
<script type="text/javascript" language="JavaScript">
<!--
// http://www.wallpaperama.com
function openwindow(url, width, height) {
var win;
var windowName;
var params;
windowName = "features";
params = "toolbar=0,";
params += "location=0,";
params += "directories=0,";
params += "status=0,";
params += "menubar=0,";
params += "scrollbars=1,";
params += "resizable=1,";
params += "top=50,";
params += "left=50,";
params += "width="+width+",";
params += "height="+height;
win = window.open(url, windowName, params);
}
// -->
</script>
2. The second thing you would need to do is to put the HTML link. For example, i want to put a link so a popup window with a 480 Width and a 380 Legth, i would use the following code to make my link work with my javascript:
CODE:
<a href="javascript:openwindow('terms.html',480,380)" style="text-decoration:underline">Click Here To View Terms</a>
You can try it for yourself, if you have windows, open notepad, copy and past the code below, then save the file as: term.html and open it with your browser.
CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Wallpaperama Javascript Tips and Tricks New Popup Window File</title>
<script type="text/javascript" language="JavaScript">
<!--
// http://www.wallpaperama.com
function openwindow(url, width, height) {
var win;
var windowName;
var params;
windowName = "features";
params = "toolbar=0,";
params += "location=0,";
params += "directories=0,";
params += "status=0,";
params += "menubar=0,";
params += "scrollbars=1,";
params += "resizable=1,";
params += "top=50,";
params += "left=50,";
params += "width="+width+",";
params += "height="+height;
win = window.open(url, windowName, params);
}
// -->
</script>
</head>
<body>
<h1>Wallpaperama Javascript Tips and Tricks New Popup Window File</h1>
<hr>
<p><a href="javascript:openwindow('terms.html',480,380)" style="text-decoration:underline">Click Here To View Terms</a></p>
<p> </p>
<p><< Go Back </p>
<p> </p>
<p align="center"><a href="http://www.webune.com">Hosting By Webune.com </a></p>
</body>
</html>