Re: IFrame.onload, IE and Remote Scripting



Tom Cole a écrit :

and there I am creating the iframe
programmatically using this:

iframe = document.createElement('IFRAME');
iframe.width = 0;
iframe.height = 0;
iframe.style.border = 'none';
iframe.id = "internal_frame";
iframe.name = "internal_frame";
iframe.src= "blank.html";
iframe.onload = function() { alert('Something'); };
document.body.appendChild(iframe);

I then load cross-domain requests by setting the src attribute of the
iframe. In opera and FF, I get my little alert box, so I'm good to go
and read the iframe's contents... But in IE, I do not get an alert
box.

With IE do you get the new file in your iframe ?

Probably better result with :
parent.internal_iframe.location = 'my_new_file.htm';
than using setAttribute();

Second of all...what is the best way to obtain the contents of the
iframe (the server response) from the onload event handling function?

I'am not very sure you'll be authorized to get the content of the iframe ...
especially if this content comes from another domain.


nota :
You can also use an 'object' insteed of an 'iframe' to include some html file.
(with much more restrictions about cross domain)


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
.



Relevant Pages

  • Re: Cross domain iframe access
    ... value of the - location - property of an IFRAME that contained a page ... babyhood and "throw" even for programmers was first associated with ... sense as one doesn't break code execution unless it is indeed ...
    (comp.lang.javascript)
  • Re: method execution problem
    ... > In the Parent.html page there is a iframe. ... > parentMethod is in the Main.js file and the js file is included in the ... > if I uncomment the alert statement in the parentMethod, method executes ...
    (microsoft.public.scripting.jscript)
  • Re: General DHTML question about ID
    ... alert -> ... so what i want to say is, i can only set the src property of an iframe ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • addEventListener to IFRAME
    ... How to execute a function on 'load' of iframe.. ... alert the title of loaded document.... ...
    (comp.lang.javascript)
  • IFrame.onload, IE and Remote Scripting
    ... in the game and XMLHttpRequest was already out there by the time I got ... handler in their server response)...and there I am creating the iframe ... I then load cross-domain requests by setting the src attribute of the ... In opera and FF, I get my little alert box, so I'm good to go ...
    (comp.lang.javascript)