View Single Post
Old 12-21-2012, 11:28 AM   PM User | #7
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
I suspect, according to the XML output:
Code:
function getCurrentTrack() {
	$.get('/player/readerPlayer.php', function (data) {
        $tracks = $(data).find('track');
        $tracks.each(function (){
            $this = $(this);
            var title = $this.find('title').text();
            var listenersn = $this.find('listeners').text();
            $('.now_playing a').html(title).attr('href', url);
            $('.listeners span').html(listenersn);
            setTimeout(getCurrentTrack, 65000);
        });
    }, 'xml');
};
Where does url come from..? Presumably you need to extract it from location.
Code:
function getCurrentTrack() {
	$.get('/player/readerPlayer.php', function (data) {
        $tracks = $(data).find('track');
        $tracks.each(function (){
            $this = $(this);
            var title = $this.find('title').text();
            var listenersn = $this.find('listeners').text();
            var locn = $this.find('location').text();
            $('.now_playing a').html(title).attr('href', locn);
            $('.listeners span').html(listenersn);
            setTimeout(getCurrentTrack, 65000);
        });
    }, 'xml');
};
But you need to escape the ampersand & and other characters in the XML as it is not valid otherwise:
Quote:
& &
' '
" "
&lt; <
&gt; >
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS

Last edited by AndrewGSW; 12-21-2012 at 11:34 AM..
AndrewGSW is offline   Reply With Quote
Users who have thanked AndrewGSW for this post:
guytrance (12-21-2012)