Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > loading contents of external file into div via iframe

Reply
Thread Tools

loading contents of external file into div via iframe

 
 
crescent_au@yahoo.com
Guest
Posts: n/a
 
      12-06-2006
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.innerHTM L');
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
possible viewport question, need to control what portion of div contents appear when overflow:auto and too much content in div Jake Barnes Javascript 1 09-05-2007 11:00 PM
print div only, via copying into hidden iframe first jon Javascript 10 12-06-2006 04:54 AM
Need to get offsetLeft of an iframe or div inside another iframe Nathan Carr Javascript 0 09-17-2004 01:27 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM
Creating a CSS class to use in DIV to affect all contents of the DIV??? Some One HTML 5 08-09-2003 03:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57