By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

can't access dynamically generated javascript function in parent frame

P: n/a
Hello all,

I have a page called test.html. Within test.html I have an iframe
whose source is mypage.html. When mypage.html loads, it dynamically
creates a javascript element which contains a function called doIt()
and attaches it to the parent page, which is test.html. I have a
button on test.html that then needs to call the dynamically attached
doIt() function. I got this to work fine on Firefox and Opera on the
Mac, but Safari is holding out on me. Any thought on this?? Any help
would be appreciated.

Thanks!
chh

Oct 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


ch**************@gmail.com wrote:

I have a page called test.html. Within test.html I have an iframe
whose source is mypage.html. When mypage.html loads, it dynamically
creates a javascript element which contains a function called doIt()
and attaches it to the parent page, which is test.html. I have a
button on test.html that then needs to call the dynamically attached
doIt() function. I got this to work fine on Firefox and Opera on the
Mac, but Safari is holding out on me.


What are you doing, creating a <script> element with e.g.
document.createElement('script')
and inserting that into the document?
I think only the latest Safari 2.0.1 supports that, see
<http://webkit.opendarwin.org/blog/?p=26>
which says "Added support for loading external scripts and executing
inline scripts by dynamically adding <script> elements to the DOM."
--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 19 '05 #2

P: n/a
Thanks, yes that is what I was doing. I figured out that the Safari
version I was using didn't support that. Sucks to be me....I did
figure out a way to do it though but had to take a whole different
approach.

Oct 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.