Adding $.mobile.loading(''); to JQUERY MOBILE MULTI PAGES

Adding $.mobile.loading(''); to JQUERY MOBILE MULTI PAGES

I use the following code for single page:
$ ( document ). ready ( function () { $ . mobile . loading ( 'show' ); }); $ ( window ). load ( function () { $ . mobile . loading ( "hide" ); });
 
When I use multi page template of Jquery mobile, the code only works on the first page of my app created by phonegap. How can I use them to all app pages?