I'm having some problems with this unobtrusive javascript code.
The javascript turns any link with class="popup" into a popup window... in firefox. In Ie, the links just run normally.
Code:function buildPopups() { var popupLinks=document.getElementsByTagName('a'); //this tells the browser what tags to apply this to for (var i=0;i<popupLinks.length;i++) if (popupLinks[i].getAttribute("class")=="popup") { //if the link has a class of popup... popupLinks[i].onclick = function() { //when it's clicked on... openWindow(this.getAttribute("href")); //run the openWindow() function return false; //kills the link so it wont fire normally } } } function openWindow(myURL) { //popup Function window.open(myURL,'popup'); } window.onload=buildPopups; //run the popup function when the page loads



Reply With Quote

Bookmarks