• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 515
  • Last Modified:

How do you call another function from with in this jquery

I want to call another funtion at my comments

$(window).load(function () {
  $('#set_location_image').fadeIn(2000);
///how do I can another function here  
});

Open in new window

0
Luey
Asked:
Luey
  • 2
1 Solution
 
LueyAuthor Commented:
comment should have said  //how do I call another function here
0
 
tdlewisCommented:
You can enter any valid JavaScript at that location. Here's a example:
function foo(bar)
{
  return bar * bar;
}

$(window).load(function () {
  $('#set_location_image').fadeIn(2000);
  alert(foo(9)); // displays '81'  
});

Open in new window

0
 
Chris StanyonCommented:
Just call your function

$(window).load(function () {
  $('#set_location_image').fadeIn(2000);
  myFunction();
});

function myFunction() {
  alert("Hi");
}

Open in new window

0
 
LueyAuthor Commented:
Thanks that did it
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now