javascript - Force browser to re-run js file after ajax call -
i facing problem while trying call javascript file.
i have menu in html file.
home me
in second page (me
), run js file :
alert("running"); // test if browser runs js file $("#some_id").blabla; // smoething elements
when switch me
home
, , getting me
again, browser not run js file once again. means jquery's "get element id" $(#some_id")
out-to-date.
that because switch in menu ajax call.
how force browsers re-run js file after ajax call ? thanks
home
code :
<?php include('header.php'); ?> <script src="js/home.js?v=<?php echo uniqid(); ?>"></script> <script>alert("page : home");</script>
me
code :
<?php include('header.php'); ?> <script src="js/me.js?v=<?php echo uniqid(); ?>"></script> <script>alert("page : me");</script> <body> ... </body>
in me
file, javascript loaded once.
Comments
Post a Comment