jug Posted February 20, 2010 Share Posted February 20, 2010 Hi, I am experimenting with the BBC web API and have come across certain problems. It seems the status code returned from the server response is 0 and also the xml response is null. Im not totally new to Ajax development but I cant seem to see where the problem lies. The section of code is below. function channelsList(){ req = new XMLHttpRequest(); req.open("GET", 'http://www0.rdthdo.bbc.co.uk/cgi-perl/api/query.pl?method=bbc.channel.list&format=simple', true); req.onreadystatechange = channelsListResponse; req.send(null); } function channelsListResponse(){ alert(req.readyState + '-' + req.status + '-' + req.statusText); if(req.readyState == 4 && req.status == 200){ var channelsList = req.responseXML.getElementsByTagName('channel'); alert(channelsList); } } Any help would be appreciated. The prototype application can be found at the following URL. http://dev.bw-design.co.uk/sites/bbc/ Thanks in advance. Aaron B Quote Link to comment https://forums.phpfreaks.com/topic/192729-bbc-web-api-program/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.