Not Solved Refresh every 5 second
#1
Not Solved
Hi,
I just noticed that my mebers is always refreshing 5 seconds (which makes them online and eventually generate lots of time spent online, which I don't wanna).

Video: https://u.pomf.is/ypteyo.mp4

NOTE: I told the user to stay on the index page without refreshing.

Can this script be causing this?

<script type="text/javascript">
 jQuery(document).ready(function(){
var interval = 5000;
var refresh = function() {
// Ajax Request 
jQuery.ajax({
url: "usercp.php?action=notification_ajax",
data: {
key: '{$mybb->post_code}'
},
type: "POST",
dataType: "html",
success: function (data) {
$('#notificationcounter').html(data);
setTimeout(function() {
refresh();
}, interval);
},
error: function (xhr, status) {
setTimeout(function() {
refresh();
}, interval);
},
complete: function (xhr, status) {
}
});
};
refresh();
});
</script>

Thanks.  Smile
Reply


Messages In This Thread
Refresh every 5 second - by Sazze - 2016-07-30, 03:18 PM
RE: Refresh every 5 second - by MrBrechreiz - 2016-07-30, 03:51 PM
RE: Refresh every 5 second - by Matt - 2016-07-30, 04:31 PM
RE: Refresh every 5 second - by MrBrechreiz - 2016-07-30, 05:21 PM
RE: Refresh every 5 second - by Matt - 2016-07-30, 05:28 PM
RE: Refresh every 5 second - by MrBrechreiz - 2016-07-30, 06:44 PM
RE: Refresh every 5 second - by Sazze - 2016-07-30, 06:57 PM
RE: Refresh every 5 second - by MrBrechreiz - 2016-07-30, 07:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)