Avatar of zzhang2006
zzhang2006Flag for United States of America

asked on 

IFRAME and the onAfterUpdate event

I need use the "onafterupdate" event in an iframe. But it seem not working. I need a javascript get triggered
after the data in the frame has been updated. Anyone can offer a example?  Thanks.
JavaScriptScripting LanguagesJava

Avatar of undefined
Last Comment
BrianGEFF719
Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

You could do something like this:

<script>
  function myFunction(){
   alert(myIFRAME.document.innerHTML); /* alert html when loading is complete
  }
  myIFRAME.document.onload = myFunction;
</script>
Avatar of Jaax
Jaax
Flag of India image

Hi,
 Try something like this

<script for="formelement" event="onafterupdate">
    alert("Value has changed");
</script>
...
><input id=formelementtype=text datasrc=#myDataSrc datafld=formelement>
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

As explained by Author:BrianGEFF719,   An event to trigger is onload

You could specify the onload event as an attribute

<iframe src="http://www.yahoo.com" onload="alert ('IFRAME Loading complete');">



Avatar of zzhang2006
zzhang2006
Flag of United States of America image

ASKER

thanks,  I tried the onload it did start a javascript function. But when I try to open another URL in
the triggered function (loading it to a different iframe), it freezes. Is this an synchronization problem
or the problem with the onload? Here is my onload function. Any suggestions? I need to open another
site and write it to a different iframe without restart the current page. Thanks again.

<iframe .myFrame1.  onload ="postResults()" ..>

function postResults()
         {
            myFrame2.document.open("../responses/o101.html","myFrame2");
         }
ASKER CERTIFIED SOLUTION
Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo