Javscript How To Make Link With New Browser Popup Window HTML Code Script
RegisterLogin
Webune Forums » Javascipt » Javscript How To Make Link With New Browser Popup Window HTML Code Script
Javscript How To Make Link With New Browser Popup Window HTML Code Script
Post Description: Javscript How To Make Link With New Browser Popup Window HTML Code Script
Tags: Javscript, How, To, Make, Link, With, New, Browser, Popup, Window, HTML, Code, Script
This Post Was Posted On Feb 29, 2008 By edwino85 #1408
Post Description: Javscript How To Make Link With New Browser Popup Window HTML Code Script
Tags: Javscript, How, To, Make, Link, With, New, Browser, Popup, Window, HTML, Code, Script
This Post Was Posted On Feb 29, 2008 By edwino85 #1408
Javscript How To Make Link With New Browser Popup Window HTML Code Script by edwino85
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>
<!--
// 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>
<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>
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Wed Dec 21, 2011 4:19 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3