C
crescent_au
Hi all,
I am trying to load contents of external html file into div but I am
not able to do it. However, using onclick to call the same function
works.
My code is attached below. Please read comments on UPPERCASE.
<iframe id="features" name="features" src="products/toys/features.html"
style="display:none;"></iframe>
<span><a href="#" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('Image35','','images/buttons/rollover/feature_rollover.jpg',1)"><img
src="images/buttons/features.jpg" name="Image35" width="85" height="18"
border="0" id="Image35" onclick="load_text('features')" /></a></span>
<!-- HERE load_text() WORKS -->
<div id="textChange"></div>
<script language="javascript">load_text('features');</script><!-- HERE
load_text() DOESN'T WORK -->
---------------------------
// .js file
function load_text(buf) {
document.getElementById('textChange').innerHTML =
eval('window.frames.'+buf+'.document.body.innerHTML');
}
I am trying to load contents of external html file into div but I am
not able to do it. However, using onclick to call the same function
works.
My code is attached below. Please read comments on UPPERCASE.
<iframe id="features" name="features" src="products/toys/features.html"
style="display:none;"></iframe>
<span><a href="#" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('Image35','','images/buttons/rollover/feature_rollover.jpg',1)"><img
src="images/buttons/features.jpg" name="Image35" width="85" height="18"
border="0" id="Image35" onclick="load_text('features')" /></a></span>
<!-- HERE load_text() WORKS -->
<div id="textChange"></div>
<script language="javascript">load_text('features');</script><!-- HERE
load_text() DOESN'T WORK -->
---------------------------
// .js file
function load_text(buf) {
document.getElementById('textChange').innerHTML =
eval('window.frames.'+buf+'.document.body.innerHTML');
}