Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Unable to call function in from another frame in Opera and IE

Reply
Thread Tools

Unable to call function in from another frame in Opera and IE

 
 
Rasmus Rimestad
Guest
Posts: n/a
 
      03-03-2005
Hi!
In a database application I am building I have a form which is constructed as two frames where the
top frame (name == top) shows some information about the element currently displayed and the main
frame (name == main) which contains the form itself.

Now, I have a small image in the top frame which will change to become a floppy disk whenever the
form in the main frame is changed so that the user is reminded to save what he/she has done.

This works very well in Firefox, however in Opera and IE the functions changing the image work only
when called from the top frame. When they are called from the main frame, the following error
appears in Opera:


http://localhost/index.php?c=partici...rticipantID=10
Event thread: onclick
Error:
name: TypeError
message: Statement on line 1: Expression did not evaluate to a function object: parent.top.changeToDisk
Backtrace:
In unknown script
parent.top.changeToDisk();
At unknown location
{event handler trampoline}

IE ignores the entire thing, does nothing, and does not output any error either.

The code looks like this:

IN THE TOP FRAMEN:
-= HTML: =-
<img src="blank.gif" name="savedImg">


-= JavaScript: =-
changed = 'disk.gif';
blank = 'blank.gif';

function changeToDisk() {
document.savedImg.src = changed;
}

function changeToBlank() {
document.savedImg.src = blank;
}

function isNotChanged() {
if(document.savedImg.src == changed) {
alert('You have made changes!');
return false;
} else {
return true;
}
}

IN THE MAIN FRAME:
-= HTML: =-
<input type="text" name="firstName" maxlength="50" value="[field_firstName]" class="mediumText"
onChange="parent.top.changeToDisk();">

Does anyone know of any solutions to this?

--
Rasmus Rimestad, webprogrammerer
Webdatabaser til en pris du kan leve med --> http://www.rimestad.no
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to refer to a function in a frame from another frame? laredotornado@zipmail.com Javascript 0 05-21-2007 04:20 PM
Comparisons of IE, Opera and Firefox on DOM (Javascript/CSS) support(Opera wins) Bob HTML 24 05-21-2006 05:31 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Opera 7.53 vs Opera 6.0 ? Hockey Buff Computer Support 3 08-17-2004 08:53 PM
JavaScript error (Opera, Netscape) - calling function from different frame Dan Tartakovsky Javascript 5 12-05-2003 02:17 PM



Advertisments