how to write an inline function in javascript...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

how to write an inline function in javascript...

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

window.onclick = function() { /* your function junk here */ };
Remember to end the statement with a semicolon...
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post 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???
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

neither. It is written, exactly like I typed.
Post Reply