I have an external javascript running that i downloaded from the internet and used in my html page. It lets links being displayed in an iframe.
Here's the script:
Inside the html, this is the code i use for the iframe:
The code for triggering a link inside the html:
For some reason, this script works great in IE, but it doesn't work in Chrome (links don't respond at all) and in Firefox (works, but frame is veeeery tiny).
I can't figure out how to change it to make it work on IE and the others.
Can somebody help me out pls?
Thanks in advance for the efford
Here's the script:
Code:
/*************************************************************************
This code is from dyn-web.com
free for all uses as long as this notice retained
*************************************************************************/
/* dw_loader.js version date: July 2008
loads url in iframe, transfers body content into div
provides defaults for iframe and display div ID's
also supports use with multiple iframes and divs
optional message for loading in display div
supports functions to be called once the div has been populated with new content
function in iframed document can be invoked should some operations need to be performed from there
*/
function dw_loadExternal(url, ifrmId, divId, bLoadMsg) {
// defaults for iframe, display div
ifrmId = ifrmId || 'buffer'; divId = divId || 'display';
if ( window.frames[ifrmId] ) {
// Could use location.replace method if you do not want back button to load previous iframe url
//window.frames[ifrmId].location.replace(url);
window.frames[ifrmId].location.replace(url);
// If you want the whole page to scroll to the top when new content is loaded
//window.scrollTo(0,0);
var lyr = document.getElementById? document.getElementById(divId): null;
if ( lyr && bLoadMsg ) { // Option to display message while retrieving data
lyr.innerHTML = '<p>Retrieving data. Please wait ...</p>';
lyr.style.display = 'block';
}
return false;
}
return true; // other browsers follow link
}
Inside the html, this is the code i use for the iframe:
Code:
<div id="display"><p><!--webbot
bot="HTMLMarkup" startspan --><IFRAME id="buffer" name="buffer" height="100%" frameborder="0" width="100%" src="section.htm" onload="dw_displayExternal(this.href)"><!--webbot bot="HTMLMarkup" endspan --><!--webbot
bot="HTMLMarkup" startspan --></IFRAME><!--webbot bot="HTMLMarkup" endspan --></p>
</div>
The code for triggering a link inside the html:
Code:
<a
href="purchasing/Section_00rev.htm" onclick="return dw_loadExternal(this.href)">Section<strong>
00</strong></a>
For some reason, this script works great in IE, but it doesn't work in Chrome (links don't respond at all) and in Firefox (works, but frame is veeeery tiny).
I can't figure out how to change it to make it work on IE and the others.
Can somebody help me out pls?
Thanks in advance for the efford