View Single Post
  #1 (permalink)  
Old Apr 17th, 2008, 22:59
CloudedVision's Avatar
CloudedVision CloudedVision is offline
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 21 Times in 21 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Calling functions with variable?

Is it possible to call a function with a variable. For example this works:

Code: Select all
var myfunc = function() {
    alert("Hello!");
}

function call_function(func) {
   func();
}

call_function(myfunc);
But can you do it without defining the function as a variable? Can you just do function myfunc instead of myfunc = function()?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Reply With Quote