JSFiddle - React, Tailwind, and code Playground
JavaScript
function getCrossDomainJson(url, callback) {
$.ajax({
url: "http://query.yahooapis.com/v1/public/yql?callback=?",
data: {
q: 'select * from xml where url="' + url + '"',
format: "json"
},
dataType: "jsonp",
success: callback
});
}
function A(MyStatus){
alert(MyStatus.someProperty)
if (MyStatus.someProperty == 'false'){
function pulsate() {
$(".image2_template").
animate({opacity: 0.1}, 1500, 'linear').
animate({opacity: 1}, 1500, 'linear', pulsate);
}
pulsate();
}else {
$('.image2_template').animate({
opacity: 0,
});
$('.text3_template').animate({
opacity: 0,
});
}
}
$(document).ready(function(){
var MyStatus = {};
getCrossDomainJson("http://xproshowcasex.channel-api.livestream-api.com/2.0/getstream", function(data) {
// data is in JSON format:
//alert(data);
if (data && data.query && data.query.results && data.query.results.channel) {
MyStatus.someProperty = (data.query.results.channel.isLive)
//alert(data.query.results.channel.isLive);
A(MyStatus);
}
});
});