call jquery document.ready function inside another jquery or javascript function -


i facing 1 problem trying call document.ready() function inside javascript function when calling it, says "function not defined

here code : first function document.ready() function

$(document).ready(function expandmessagebox() {// document.ready function. have given name of "expandmessagebox"} 

this regular javascript function in trying call above function

function showmessagebox() {     expandmessagebox();} 

but giving me error : "uncaught referenceerror: expandmessagebox not defined"

where doing wrong... please help

tons of in advance

you need define expandmessagebox function in common scope. this:

function expandmessagebox() {   //your staff } function showmessagebox() {   expandmessagebox(); } $(document).ready(expandmessagebox); 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -