Welcome Guest, Not a member yet? Register   Sign In
functions within function?
#1

Saw this example on the web. What's the purpose of the two functions being contained in a function? Why would someone put that top line in there? The two functions should work without it I would think.

Code:
$(function () {
  $("div.class").click(function(){
    //Doo something

  });

  $("div.secondclass").click(function(){
    //Doo something
  });

});
Reply


Messages In This Thread
functions within function? - by cupboy - 07-14-2015, 03:17 PM
RE: functions within function? - by CroNiX - 07-14-2015, 05:28 PM
RE: functions within function? - by ivantcholakov - 07-15-2015, 12:33 AM
RE: functions within function? - by Blair2004 - 07-17-2015, 10:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB