I have an html page with two frames named: A and B. All javascript
functions are in top object.

document A has an element "<div id=sample>sample test</div>", I'm
trying to attach an click event to it from top object like this:

var obj = top.A.document.getElementById('sample'); // jquery format
like $('#sample', top.A.document)
                                                                           //
doesn't work on this.
$(obj).click(function(){
  alert('test');
});

Same code works in Safari, but not in IE.

Another issue is with ".html" method.  When I do use $('#id',
window.document) format to retrieve an element in a different frame, I
can set that #id's html as empty by doing $('#id',
window.document).html(""). However, if I use $("#id",
window.document).html("insert this part as html"), it failes.

Can someone help me?

Thanks

Y

Reply via email to