
Originally Posted by
sina_izad
hi there
i was wondering if it is possible to place a frame or an iframe on a page with a remote src and then access DOM objects of that page from main window to edit.
say <iframe src="http://www.google.com"></iframe> and then read all the innerHTML inside iframe and write that to a div.
for examle:
<script>
function change() { ht=window.frames[0].document.getElementById('innerdiv').innerHTML;
document.getElementById('outerdiv').innerHTML = ht
}
</script>
<button onclick = "change()">press</button>
<frame src="http://www.google.com" frameborder = "1"></frame>
<div id= "outerdiv"></div>
thanks
You can't do that sorry.
edit: I should elaborate...
You cannot in any browser access html code (excluding javascript) of a page with a different domain and subdomain. If you could, no end user would be safe.
The most you can do is this...
Code:
<script type="text/javascript" src="different domain"></script>
Bookmarks