javascript function

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2007
Posts: 1
Reputation: annomalis is an unknown quantity at this point 
Solved Threads: 0
annomalis annomalis is offline Offline
Newbie Poster

javascript function

 
0
  #1
Jun 1st, 2007
Hi ,can anyone tell me if we pass a function to another function as a parameter in javascript?
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,642
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 472
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: javascript function

 
0
  #2
Jun 3rd, 2007
Yes.

  1. <html>
  2. <head>
  3. <script>
  4. function add(a, b)
  5. {
  6. alert(a + b);
  7. }
  8.  
  9. function takingFunction(x, y, func)
  10. {
  11. func(x, y);
  12. }
  13. </script>
  14. <head>
  15. <body>
  16. <form>
  17. <input type="submit" value="Submit" onclick="javascript:takingFunction(2, 3, add)" />
  18. </form>
  19. </body>
  20. </html>
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC