• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

how to access inner frame elements from parent document  RSS feed

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys , my question is how to access the inner frame elements and change their contents from parent documents

actually I am having images inside <span> in inner frame , so i tried to do the following but coudn't go well

var a = window.frames['I1'].document.forms['form2'].elements[0] ;

a.innerHTML='<img src="images/img4.jpg" width="287" height="97" />'

it gives me error I don't know why !!!


here is my code in inner frame

<div name="div1" style="position: absolute; width: 502px; height: 323px; z-index: 1; left: 9px; top: 21px" id="layer1" class="style12">
<form method="post" action="" name="form2">
<span id="center">


<img src="images/img2.jpg" width="287" height="97" /><br />
<br />
<img src="images/img1.jpg" width="287" height="97" />

</span>
</div>



thanks in advance
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It gives me error I don't know why !!!



What is the error???

Eric
 
alsoumahi alBatal
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:

It gives me error I don't know why !!!



What is the error???

Eric



the error is "output error" , this the error appears when I run and test the page on web expression program .

other scripts run fine , but this one gives me error .

is there any way to access iframe elements , and what element I should put for my images in order to access to it from parent frame and do proper process

thanks in advance
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you think elements[0] is?

 
alsoumahi alBatal
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:What do you think elements[0] is?



I think the span element of the form , if my answer is not correct please advice me what to do please
how to change the content of images inside the span ???
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!