Function inside document ready JQuery can't be called from JS(Outside)

Viewed 23
<script> 
$(document).ready(function () {
  testFunction(){
   //do some hard work~   
   }
});
testFunction(); //not working
<script/> 

I'm trying to call testFunction which is inside the JQuery, but it's not working. Following error is occuring: testFunction is not defined

0 Answers
Related