Javascript help with iframes

I normally manage to avoid this stuff but I need to have a button that toggles between old pages ending .htm and new ones ending .html

I thought it would be fairly easy but I have hit a snag.

window.frames[0].location = "index.htm" works OK

alert(window.frames[0].location) fails mysteriously

I have also tried qualifying it .href etc no joy :(

The actual code is

The output is: fully qualified filename for the HTML file 1 frames[0] changes to show contents of index.htm (as expected) crashes out here

In short I want a foolproof way of obtaining the URL name of the page being displayed in a particular IFRAME so that I can adjust it. (adding or removing a trailing "L" according to taste)

I happen to know in this case that it will be in frames[0].

I have never encountered a situation where you can successfully assign a string to a variable/property and then not be able to look at it again.

Can anyone see what I am doing wrong? I can't! Thanks for any enlightenment.

--
Regards, 
Martin Brown
Reply to
Martin Brown
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.