Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Hi could you please code review the following, my concern is XML parsing is hardcoded:

    Ext.Ajax.request({
        url: storageDataItem.contentlink,
        success: function (response) {
            var store;
            try {
                var parser = new DOMParser();
                // TODO: remove extra lines or ignore on parsing. How? :)
                var xml = parser.parseFromString(response.responseText, "text/xml");
                var mediaContentURL = response.responseXML.childNodes[0].childNodes[0].childNodes[1].lastChild.attributes[0].nodeValue;
                var title = xml.getElementsByTagName('title')[1].childNodes[0].nodeValue;
            } catch (e) {
                // ignore exception
            }
            console.log("storage: ")
        }
    });
    this.fireEvent("playButtonTapped", storageDataItem);
    this.fireEvent("playAudioFile", title, mediaContentURL);

The actual feed: http://audioserver.arn.com.au/getMediaPlaylist.aspx?MediaId=1834

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.