473,508 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

function won't execute twice

2 New Member
Hi everybody,

I've Googled some hours now to find a solution, but I'm really stuck.

This is my situation:

I have a <div id='content'> where the content is loaded with Ajax, and some buttons outside the div. Everything works perfect.
At some time I'm loading an <iframe id='frame'> in the content-div. The iframe has a php as source wich creates a form, and loads form.js

Then from outside the content-div I execute window.form1_frame.nws_check(210,y); to call the function nws_check in form.js to check and post the form. If everything is processed, I kill the iframe with document.getElementById('content').innerHTML="" and re-use the content-div for other content.
Everything is working fine untill I create <iframe id='frame'> for a second time.

In IE7 it works perfect, calls the functions again and so on...
but in Firefox (3.0.13) I get an error:
window.form1_frame.nws_check is not a function

when I check what js is loaded when the Iframe is killed, there is no form.js
and when I load the iframe the second time, form.js is there.

when I test in form.js with if(typeof nws_check == 'function') {alert("I'm here")}
it fires the alert, so the function is there, in the same iframe as the first time, in the same div.
But still I get the error.

Any solutions?
Regards, Michel
Aug 13 '09 #1
1 2541
Ernie13
2 New Member
SOLVED

it's not: window.form1_frame.nws_check(210,y)

but

var obj = document.getElementById('form1_frame')
obj.contentWindow.nws_check(210,y);
Aug 13 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
8855
by: icui | last post by:
The following script generates two files copies. (I expect that a new file is created in my $wrk_dir) The same script executed without Apache works properly and generates single file copy. ...
0
8415
by: rahulkate | last post by:
Hello Everybod I have a problem hope you can help me out I have a treeview and on the selectedindexchange event of the treeview I want to execute some code from the vb codebehind file and a...
4
2981
by: Julia | last post by:
Hi Everyone, I am using webbrowser control to post data to an aspx page. However, for some reason, the aspx page sometimes will execute page_load event twice, and sometimes execute it once. So I...
1
6562
by: Timothy Perrigo | last post by:
(PostgreSQL 8.0 beta 4 on Mac OS X 10.3.6) I'm working on a function which creates and populates a temporary table, then returns the number of records it has inserted. I'm getting an error,...
23
7769
by: bluejack | last post by:
Ahoy... before I go off scouring particular platforms for specialized answers, I thought I would see if there is a portable C answer to this question: I want a function pointer that, when...
1
1553
by: Arnaud Diederen | last post by:
Hello everyone, I have a little problem with IE6. Imagine I have a webapp that has a main/root/parent window, in which there is a function (called: executor()) that makes use of the...
12
8329
by: mart.franklin | last post by:
I hope I am not being too ignorant :p but here goes... my boss has written a bit of python code and asked me to speed it up for him... I've reduced the run time from around 20 minutes to 13 (not...
6
5883
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
4
4373
by: Immortal_Nephi | last post by:
I had a lot of research to see how function pointer works. Sometimes, programmers choose switch keyword and function in each case block can be called. Sometimes, they choose ordinary function...
0
7379
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...
1
7038
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...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.