473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

can't access dynamically generated javascript function in parent frame

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
2 3442


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dom | last post by:
I have a frameset with a left right columns, called 'index' and 'content'. The left column of the frameset ('index') loads an index.htm file which have these hrefs (summarized the code a bit)...
1
by: Cindy Lee | last post by:
I'm trying to dynamically set the height of my Iframe. my https: main page is calling another https in an Iframe. But i get an access denied error from my javascript trying to call the parent...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
1
by: rainbowii7 | last post by:
Calling all programmers for helllllllllllllllppppp!!! i am currently doing a uni degree and our lecturers have set us the task of making a game in JavaScript. i chose to do a hangman game and...
26
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
1
by: Bengt-Erik Eliasson | last post by:
Hello! In my mainpage i have two frames (MENU and MAIN). In the MAIN I load another page with frames (Sub_Frame.htm). It contains TOP and BOTTOM frame. In BOTTOM frame I have a page with a button...
13
by: John Smith | last post by:
I am using IE 6.0 from http://www.javaworld.com/javaworld/jw-07-1996/jw-07-javascript-p2.html I gather that "If you need to test a number of command lines, you can reduce the keystrokes by...
5
by: BeanWorks | last post by:
Hi, I've been looking through books and posts, but so far I can't find anything that really addresses this problem. I have a frameset page with three frames, one on top with static content, and...
6
by: suresh_nsnguys | last post by:
Hi, This is my first message to this forum.I am facing one problem in frames.when i am trying to access child frame from parent frame i am getting "Access Denied Error".i know the reason bcz i...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.