OpenFunction.js
function Popup(winURL) {
window.open(winURL,"Popup","width=320, height=480");
}
window.onload = PrepareLink;
function PrepareLink() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
for (var i=0; i<links.length; i++) {
if (links[i].getAttribute("class") =="Popup") {
links[i].onclick = function() {
Popup(this.getAttribute("href"));
return false;
}
}
}
}
Popup.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/JavaScript" src="OpenFunction.js">Checking</script>
</head>
<body>
<!--a href="http://www.example.com/" οnclick="Popup('http://www.example.com/'); return false;">Example</a-->
<!--a href="http://www.example.com/" οnclick="Popup(this.getAttribute('href')); return false;">Example</a-->
<!--a href="http://www.example.com/" οnclick="Popup(this.href); return false;">Example</a-->
<a href="http://www.example.com/" class="Popup">Example</a>
</body>
</html>