javascript - How to reload a dynamic content using script -
i have page contains dynamic data, i'm trying reload particular <p></p>
only.
html
<p id="spa<?php echo $id; ?>"></p>
my script this
$("#spa" + id).load(location.href + " #spa" + id);
but it's not working, appreciated.
following shows how add new script tag script reload
<script language="text/javascript"> function load_js() { var head= document.getelementsbytagname('head')[0]; var script= document.createelement('script'); script.type= 'text/javascript'; script.src= 'source_file.js'; head.appendchild(script); } load_js(); </script>
the main point inserting new script tag -- can remove old 1 without consequence. may need add timestamp query string if have caching issues.
Comments
Post a Comment