issue calling jquery function from javascript -


having issue calling jquery function javascript function. sure have done before... cant understand issue having. provide.

$(document).ready(function(){     function funb() {         alert("b working");     }; });  funa(); function funa() {     alert("a working");     funb(); }; 

http://jsfiddle.net/dannyj6/8gxhh/4/

you either need put them within same enclosure:

$(document).ready(function(){     function funb() {         alert("b working");     };      function funa() {         alert("a working");         funb();     };      funa();    });  

example fiddle

or alternatively, put funb on window it's accessible funa:

$(document).ready(function(){     window.funb = function() {         alert("b working");     }; });  funa(); function funa() {     alert("a working");     funb(); }; 

example fiddle


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -