Help with Firefox Javascript Issue
Posted: Sun Sep 20, 2009 7:46 pm
Thanks in advance for any help. I recently took over a site that uses some JavaScript in order to make a link work on one of it's pages. To be honest I am not strong with JavaScript but am decent at usually finding what I need to edit to make something work. My issue is that this JavaScript successfully opens a URL in IE, however in Firefox you can click till you are blue in the face and nothing happens. Can you please look at the script below and let me know if anything catches your eye as something that would not work in Firefox? Also, and I do not know if it helps, but there is no "a href" on this page as the body tag contains the call to the JavaScript, as the image which is actually the link is the only thing on this page (the page is in an iFrame). Even though I develop in PHP this site is actually in classic ASP but since I always get great help on this forum I wanted to ask here.
Code: Select all
<body onclick="load('<%=pURL%>');" bottommargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<table width="288" border="0" cellspacing="0" cellpadding="0" onMouseOver="this.style.cursor='hand';" onMouseOut="this.style.cursor='';">
Code: Select all
<script>
function load(val){
if(val.length!=0) {
var strURL = new String(val);
val=strURL.replace(/#/g,"'");
if(val.substring(0, 10)=='javascript'){
strURL=val;
val=strURL.replace(/javascript.popup/g,"window.open");
eval(val);
//eval('window.open'+val.substring(16));
}else{
window.parent.parent.parent.navigate(val);
}
}
}
</script>