iframe.src reload ?

  • Thread starter Alexandre Jaquet
  • Start date
A

Alexandre Jaquet

Hi I wanna know how can I reload an iframe does I've to move my iframe
into another form an do a submit or may I can do it by another way

rigth now I'm been doing :

my form name is mainform and my iframe name is preview
function urlRewrite () {
...
this.document.mainform.preview.src = 'xxxx';
}
thx in advance
 
P

Phlip

Alexandre said:
Hi I wanna know how can I reload an iframe does I've to move my iframe
into another form an do a submit or may I can do it by another way

rigth now I'm been doing :

my form name is mainform and my iframe name is preview
function urlRewrite () {
..
this.document.mainform.preview.src = 'xxxx';
}

I suspect I just asked that. The best answer was:

Richard said:
Phlip said:
JavaScripties:

On the HTML side, we load an IFRAME with a blank page:

<iframe frameborder="0" marginwidth="0" marginheight="0"
scrolling="off" src="about:blank" id="iframe_xml1!format_text"
name="iframe_xml1!format_text" width="90%" height=" 180 ">My
site is inferior and doesn't deserve your support.</iframe>

Later, a button click populates this frame:

var iframe = window.frames[iframeName];
iframe.src = outputUrl;

That works on IE but not FireFox. Any tips?

The object returned by references via the - frames - collection are
window/frame object, while the object representing the HTML IFRAME
element would be found in the DOM of the document in the window/frame
object containing the - frames - collection. The - src - property is
expected to be on the IFRAME element (though frequently read only) not
the window object within the IFRAME.

To navigate window/frame object the normal practice is to assign a URL
to the location property of the frame in question (or assign a URL to
the - href - property of the object already referred to by the location
property):-

iframe.location = outputUrl;

If that didn't help, say what you are trying to do with pseudocode.
 
N

nutso fasst

Alexandre Jaquet said:
Hi I wanna know how can I reload an iframe does I've to move my iframe
into another form an do a submit or may I can do it by another way

Iframe isn't a form element.

You give your iframe an ID, e.g.:
<iframe id="myif" src="[initialURL]"></iframe>

This ECMA script changes src property:

document.getElementById("myif").src = "[newURL]"

nf
 
A

Alexandre Jaquet

nutso fasst a écrit :
Hi I wanna know how can I reload an iframe does I've to move my iframe
into another form an do a submit or may I can do it by another way


Iframe isn't a form element.

You give your iframe an ID, e.g.:
<iframe id="myif" src="[initialURL]"></iframe>

This ECMA script changes src property:

document.getElementById("myif").src = "[newURL]"

nf

yep thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top