Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.match-dates').on('afterChange', function () {
- var currentSelectionDate = $('.match-dates .slick-current > div > div').attr('data-date');
- var liveStatus;
- if(currentSelectionDate == null){
- liveStatus = 1;
- $.get('/api/index.php?request=GetLiveMatchesSpecial', function ( data ) {
- $('.lives').html(data);
- });
- } else {
- liveStatus = 0;
- $.get('/api/index.php?request=GetFixturesSpecial&date=' + currentSelectionDate, function ( data ) {
- $('.lives').html(data);
- });
- }
- if(liveStatus === 1){
- console.log(liveStatus);
- setInterval(function () {
- $.get('/api/index.php?request=GetLiveMatchesSpecial', function ( data ) {
- $('.lives').html(data);
- });
- }, 5000);
- } else {
- console.log(liveStatus);
- clearInterval();
- }
- });
- let interval;
- $('.match-dates').on('afterChange', function() {
- var currentSelectionDate = $('.match-dates .slick-current > div > div').attr('data-date');
- var liveStatus;
- if (currentSelectionDate == null) {
- liveStatus = 1;
- $.get('/api/index.php?request=GetLiveMatchesSpecial', function(data) {
- $('.lives').html(data);
- });
- } else {
- liveStatus = 0;
- $.get('/api/index.php?request=GetFixturesSpecial&date=' + currentSelectionDate, function(data) {
- $('.lives').html(data);
- });
- }
- if (liveStatus === 1) {
- console.log(liveStatus);
- interval = setInterval(function() {
- $.get('/api/index.php?request=GetLiveMatchesSpecial', function(data) {
- $('.lives').html(data);
- });
- }, 5000);
- } else {
- console.log(liveStatus);
- clearInterval(interval);
- }
- });
Add Comment
Please, Sign In to add comment