I can use $('#id', window.document) to get an existing element from a
document in a frame.
However,  I also try to use $(html) to create a new DIV in any frame
through function on top window and used the format "$('<div>new div
text here</div>', window.document)", but it doesn't work.  Is it
possible to do this?

Thanks.

<html>
<head>
<script src='jquery.js'></script>
<script src='jQuery.frameReady.js'></script>

</head>
<script>

top.addDiv = function (window) {
      var doc = window.document;
      var a =   $('<div>test div</div>', doc);
      alert(top.left.document.body.innerHTML);
      $('#show', doc).toggle();
}

</script>
<FRAMESET cols="20%, 80%">
  <FRAME name=left src="testleft.html">
  <FRAME name=right src="testright1.html">
</FRAMESET>
</html>

Reply via email to