[Javascript] Safari Bug in latest release
Roger Roelofs
rer at datacompusa.com
Mon Nov 15 15:30:00 CST 2004
Terry,
On Nov 15, 2004, at 3:13 PM, Terry Riegel wrote:
> Thanks for the reply.
>>> var a = parent.toolbar.document.getElementById('delete');
>>> I added an alert to see if I could figure it out.
>>> alert( parent.toolbar.document );
>>> and it says "Undefined". Any ideas how I can fix this. It used to
>>> work until I upgraded to the latest OS update whick included bug
>>> fixes for Safari.
>>
>> Without seeing your page, nothing specific. Choose 'Log Javascript
>> Excpetions' from the 'Debug' menu and open Console for a more
>> specific error message. My first test would be to change it to
>> 'window.parent.toolbar.document' otherwise, all you can do is alert
>> on each step to see where it fails i.e.
>>
>> alert( parent );
>> alert( parent.toolbar );
>> alert( parent.toolbar.document );
>>
>> If you are in a frameset you could try
>> window.parent.frames['toolbar'];
>
> Here is what I get, still no clue how to solve it. As I see it the
> javascript is valid, Safari has broken and I need to build a hack.
> Does this seem like a fair assessment?
>
> alert( parent.toolbar.document ); - Undefined
> alert( parent.toolbar ); - Nothing Displays
> alert( parent ); - [Object Window]
>
> alert( window.parent.toolbar.document ); - Undefined
> alert( window.parent.toolbar ); - Nothing displays
> alert( window.parent ); - [Object Window]
> alert( window ); - [Object Window]
>
>
> This is the HTML for the parent frame
> <html>
> <title>File Manager </title>
> <frameset rows="50,27,*" border="0" frameborder="0" border="0"
> framespacing="0">
> <frame SRC="toolbar.html" name="toolbar" scrolling="no"
> marginwidth="0" marginheight="0">
> <frame SRC="path.html" name="path" scrolling="no" marginwidth="0"
> marginheight="0">
> <frameset cols="33%,67%" frameborder="1" border="01"
> framespacing="4">
> <frame SRC="browse.html" name="browse" scrolling="yes"
> marginwidth="0" marginheight="0">
> <frame SRC="details.html" name="details" marginwidth="0"
> marginheight="0" scrolling="yes">
> </frameset>
> </frameset>
> <noframes>NO FRAMES</noframes>
> </html>
>
if you are calling this from either 'browse' or 'details' then
parent.toolbar wouldn't exist. Have you tried top.frames['toolbar']?
hth
Roger,
Roger Roelofs
Know what you value.
More information about the Javascript
mailing list