hello guys i have a Div script that change each 30 mn for example can i refresh this Div Script from the data server without reloading the whole page (client side) this is the html script
<script type="text/javascript">
var today = new Date();
<script >
Div Xpath is
/html/head/script[9]/text()
CodePudding user response:
See this answer: AJAX Interval Refresh?
When you use the interval to retrieve data every x seconds, then you can select the DIV and insert the new data there.
(function update() {
$.ajax({
//Retrieve the new data here
}).then(function() { // on completion, restart after 30 seconds
//Insert new data here
//Example: $('.classname').html(data);
setTimeout(update, 30000); // function refers to itself
});
})();
CodePudding user response:
Yes You Can Change
And Make A Call To Server By Ajax.
And Change Replace HTML code By Using JS
And Everything is well Explain on Above Article
with the Help of AJAX web page will not reload
but it will become night mare if you are developing
big project