Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"Javascript Function Objects"
No comments yet. -
1 – 0 of 0
Having:
function validateFields() {
// a lot of cool and interesting code goes here.
var a = 1;
var b = 2;
var c = a + b;
}
the following
$('#submit').bind('click', function() {
validateFields();
});
is similar to this:
$('#submit').bind('click', validateFields);
and, to this as well:
$('#submit').bind('click', function() {
var a = 1;
var b = 2;
var c = a + b;
});
So you could say that
function validateFields() {
// a lot of cool and interesting code goes here.
var a = 1;
var b = 2;
var c = a + b;
}
is essentially the same as
var validateFields = function() {
// a lot of cool and interesting code goes here.
var a = 1;
var b = 2;
var c = a + b;
}
i.e.
validateFields
is not a function/method but an
object
. Therefore I conclude "Javascript is a different language in disguise."
[Image]
posted by fc at
11:54 PM
on Jun 3, 2011
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Javascript Function Objects"
No comments yet. -