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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -