I am trying to display currency information on my website. I can get currency from a website for free. I would like to display this information by putting the workload on user's browser.
I want to get xml with JSONP, parse it and display the currency with all JQuery. Here is my code below
function GetTodayCurrency() {
$.get("http://www.tcmb.gov.tr/kurlar/today.xml", function (response) {
alert(response.html)
}, "jsonp");
}
But this gives me error. It says "Uncaught SyntaxError: Unexpected token <". I think it gives me this error because there quotation in the xml.
How can I do this proper way? Is it a good practice to put this workload to Javascript? Is it better to do it on server side?