J
Justin Koivisto
This is probabally a basic question, but I don't quite understand what
is going on with this...
Say I have a variable called "myObject" which is an object created from
a class I wrote. The class has a method called "testing".
When I submit a form, I want to call it:
<form onsubmit="myObject.testing()" ...
When I click the submit button for the form, I get the following
message in Mozilla's JavaScript Console:
"Error: myObject.testing is not a function"
While trying to figure this out, I created a new function called
"test_form", and changed the form declaration to look like:
<form onsubmit="test_form()" ...
Test form looks like this:
function test_form(){
myObject.testing();
}
When I do this, the script works exactly as I had intended it to. Can
any of you js experts tell me why that is?
is going on with this...
Say I have a variable called "myObject" which is an object created from
a class I wrote. The class has a method called "testing".
When I submit a form, I want to call it:
<form onsubmit="myObject.testing()" ...
When I click the submit button for the form, I get the following
message in Mozilla's JavaScript Console:
"Error: myObject.testing is not a function"
While trying to figure this out, I created a new function called
"test_form", and changed the form declaration to look like:
<form onsubmit="test_form()" ...
Test form looks like this:
function test_form(){
myObject.testing();
}
When I do this, the script works exactly as I had intended it to. Can
any of you js experts tell me why that is?