2016-07-30, 03:18 PM
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?
Thanks.
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.