player_test
// function interroga(firstCall){ $.ajax({ //url:"http://www.hostingshoutcastpanel2.com:2199/rpc/8022/streaminfo.get?callback=?&t=" + $.now(), //url:"http://95.110.225.107:8041/stats?sid=1&json=1", url:"http://95.110.225.107:8041/stats?sid=1&json=1", dataType: 'jsonp', type: 'GET', success:function(json){ //send_data(json.data[0].rawmeta, firstCall); send_data(json.songtitle, firstCall); }, error:function(){ }, }); setTimeout("interroga(0)", 30000); //cicliamo la funzione ogni 33 secondi (passiamo ogni 30 secondi i valori dei campi che verranno processati dallo script php) }; function send_data(currentsong, firstCall){ // Utilizziamo il metodo .post() di jQuery per inviare una richiesta di tipo POST allo script PHP. /*$.post("processa.php", { artist: $('#input1').val(), song: $('#input2').val() }, function(data) { $('#output').html(data); }); */ $.ajax({ type: "POST", url: "processa11.php", data: {hidOld: $('#hidOld').val(), info: currentsong, fCall: firstCall} }).done(function( data ) { if (data.indexOf('') == -1) $('#output').html(data); }); } // Eventualmente possiamo usare piuttosto che il metodo .post(), il metodo .ajax()