views:

474

answers:

2

Is it possible to open an html page using navigateToURL and specifying a named frame in your html document. For instance, if you have an iframe on the page called "Steven", can you call

navigateToURL("someURL","Steven");

instead of something like

navigateToURL("someURL","_self");

I have tried this and it opens the URL in a new window.

A: 

I'm not sure, but you can use JavaScript:

navigateToURL("javascript:loadFrame(someURL)");

Then in your HTML page:

function loadFrame(url) {
  documents.frames[1].src=url
}
Diodeus
+1  A: 

Did you test this on local files saved to your hard drive? If so, then there are some security restrictions that you may be running in to. See the security note here.

But if you're testing this with files on a web server, and there are no cross-domain issues, then navigateToURL() should work exactly the way you're using it - if your iframe's name is "Steven" then the content should be opening in that iframe.

fenomas