Page 1 of 1

how to write an inline function in javascript...

Posted: Sat Feb 11, 2006 12:40 pm
by raghavan20
i was trying google to find out links on development of inline functions just like Java uses inline functions for event handlers....is this feature available? if available, can any of you give me an example or provide me some link which you might have across....thanks

Posted: Sat Feb 11, 2006 12:43 pm
by feyd

Code: Select all

window.onclick = function() { /* your function junk here */ };
Remember to end the statement with a semicolon...

Posted: Sat Feb 11, 2006 12:49 pm
by raghavan20
feyd wrote:

Code: Select all

window.onclick = function() { /* your function junk here */ };
Remember to end the statement with a semicolon...
do we have to put the function in single or double quotes???

Posted: Sat Feb 11, 2006 12:59 pm
by feyd
neither. It is written, exactly like I typed.