jquery - function is not defined when using $.mobile.changepage -
i want execute initialize()
function on page load, simple <body onload="initialize()">
didn't work when page called other page using $.mobile.changepage
. i've tried this, works fine when type url of page directly in browser, not redirecting.
firebug: initialize not defined
<body> <div data-role="page" id="page" data-theme="c" class="sss"> <div data-role="header"> <h1>skopje info guide</h1> </div> <div data-role="content"> <div id="map_canvas" style="width:100%; height:400px;"></div> </div> <div data-role="footer"> <h1>test</h1> </div><!-- /footer --> <script type="text/javascript"> $('.sss').live('pageshow', function (event, ui) { poptable(); initialize(); }); </script> </div> </body>
the function initialize()
in <head>
part, , poptable()
in .js file
sounds function initialize() not in calling page. either want calling page have function definition, or include function definition inside data-role=page div
Comments
Post a Comment