Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to access frames in Javascript



I have got a big trouble accessing frames of a webview in Javascript.
My webview loads a local HTML file that defines a frameset and contains a Javascript that must be able to access various elements of subframes.


For some strange reason normal access methods like

document.frameName.elementName etc. do not work and have never worked for me.

I found a workaround: in the script section of main frame I declared variables like

var topicDoc;
var alertDoc;
var messageDoc;

in the HTML files representing content of respective frames I called a JS function on load that set those variables like:

function onLoadingTopicFrame() {
	parent.topicFrame = document;
}

This way I could access those frames in the main frame like:

   topicDoc.elementName = somevalue;

It was a workaround but it worked. Not any more with OS 10.3.9. Now these onLoad functions of subframes just are not able to access parent frame - parent seems to be undefined.
Neither can I access the child frames in main frame using "ordinary" techniques like
document.subFrameName.elementName.
It seem like if Apple has even further increased "security" of communication between frames.


Has anybody met similar problems?

Regards,
Mihkel Tammepuu
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >WebDocumentText string exception (From: Joshua Ferguson <email@hidden>)
 >Re: WebDocumentText string exception (From: Hamish Allan <email@hidden>)
 >Re: WebDocumentText string exception (From: Joshua Ferguson <email@hidden>)
 >Re: WebDocumentText string exception (From: Hamish Allan <email@hidden>)
 >Re: WebDocumentText string exception (From: Joshua Ferguson <email@hidden>)
 >Re: WebDocumentText string exception (From: Hamish Allan <email@hidden>)
 >Re: WebDocumentText string exception (From: Joshua Ferguson <email@hidden>)
 >10.3.9 Changes to Webkit (From: Dave Whipps <email@hidden>)
 >Re: 10.3.9 Changes to Webkit (From: Mihkel Tammepuu <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.