script op homepage toevagen.
-
Hoe kan ik de onderstaande script zodanig toevoegen dat het alleen op de home page zichtbaar is?
<script type=”text/javascript”>
$(document).ready(function() {// Simple function that uses JQuery getJSON and JSONP request
function getstats() {// Attempt to get stats for “Demo Channel” channel
$.getJSON(‘http://linktoplayer.com/player/?c=Demo%20Channel&callback=?’, function(response) {if ( response == null || response.artist == null ) alert(‘Something went wrong!’);
$(‘.trackinfo’).html(response.artist + ‘ – ‘ + response.title + ‘<br>\
‘);
// Note: If image caching is enabled the returned URL from the player is in this style: tmp/cache/meghan.trainor.png otherwise its a full URL to the image});
}
// Execute function and start interval
getstats();// Execute this function every 10 seconds
setInterval(getstats, 10000);});
</script><span class=”trackinfo”></span>
De pagina waar ik hulp bij nodig heb: [log in om de link te zien]
- Het onderwerp ‘script op homepage toevagen.’ is gesloten voor nieuwe reacties.