how to make javascript load new data every time (without using cache data) when I redirect it to a handler(page) on mous
Date : March 29 2020, 07:55 AM
will help you Add a random number to the querystring of the file you are calling in the click event. This should trigger the browser to reload rather than use cache as you are tricking it to think it's a new page request. Example: $("#downloadbutton").live("click", function () {
var timestamp = (new Date()).getTime();
window.location = "Handlers/somename.ashx?value="+somevalue+"&xxxxx="+$(".someid").text() + "ts=" + timestamp;
|
Load Data from db, Post it with AJAX to update db, Return back to Load new data! Completely Confused
Date : March 29 2020, 07:55 AM
Does that help I want to get my data from mysql db with php and assign them to my javascript array. I have 200 records in my db and i will get 10 records randomly. , You can return your MySql rows as JSON. An example: PHP: <?php
$arr[0]['name'] = 'test0';
$arr[0]['colour'] = 'red';
$arr[1]['name'] = 'test1';
$arr[1]['colour'] = 'blue';
$arr[2]['name'] = 'test2';
$arr[2]['colour'] = 'orange';
?>
<script type="text/javascript">
<?php
echo someThings = json_encode($arr);
?>
</script>
counter = 0;
setInterval(function () {
if (counter < someThings.length - 1) {
//do something
} else {
counter = 0;
//do something with the starting element again like
alert('The name is ' + someThing[counter].name + ' and the colour is ' + someThing[counter].colour);
}
counter++;
}, 5000);
|
Loading data via ajax.load function using data-load error
Date : March 29 2020, 07:55 AM
This might help you You have to specify the element for what attribute you are looking for. Line 2 should be jQuery("div[data-load]").each(function(){
|
countdowntimer in OnlineExam autosubmit with time elapsed & load next data by AJAX & if page refresh then next l
Date : March 29 2020, 07:55 AM
Hope that helps I used Reverse countdown to zero from time set to minutes $('#hour_timer').countdowntimer({
hours: hours,
minutes: minutes,
seconds: seconds,
size: "xs",
tickInterval: 1,
timeUp: timeisUp
});
|
Is it possible to not load data first time on page load?
Date : March 29 2020, 07:55 AM
|