I am working on embedding Gecko..

Question: when a user clicks on a LINK (anchor node), I want to know when
the processing of the request is complete. i.e. if the link just updates the
existing page with content, then I would like to know when the update is
complete.. so that when I retrieve the DOM, I see the updated content..
Right now, I just sleep for a minute and then parse the DOM. Most of the
time this works, but I would like to know if there is a notifier that I
could use.

e.g. In the code below, clicking on "Populate", adds innerHTML to "div1"...
I want to be notified when the processing of clicking on anchor is done, so
that I can retrieve the DOM. I tried looking at the code but didn't see
anything that would do this. I saw nsIDocumentObserver::BeginLoad() and
EndLoad() and BeginUpdate() and EndUpdate()... Could someone point me to the
right direction.. thanks

<html>
<body>
<div id=div1>
</div>


<script>

  function populate()
  {
    var div1 = document.getElementById('div1')

    div1.innerHTML = "<b>POPULATED</b>"

  }

</script>

<a href="javascript:populate()">Populate</a><br>
</body>


</html>
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to