I am creating a project in MVC that involves using AJAX to grab XML from an external url. The issue is that I can't do something like this:
$.ajax({
url: url,
data: data,
success: success,
dataType: dataType
});
because the site I'm accessing for the xml is public and I get a XMLHttpRequest same domain policy error. My solution is to run a server side script (like PHP?) to grab the XML info and then forward it to be used by my program (a Google Maps project with marker data that updates every 15 seconds).
My question is, how would I incorporate the script to get the XML to my project? Can I use PHP? ASPX? I've never done anything quiet like this, so I just don't have a clue on how it would all fit together.
For clarification this is what I was doing:
public class HomeModel
{
public string XmlData { get; set; }
public void GetXml()
{
XmlDocument doc1 = new XmlDocument();
doc1.Load("http://www.nfl.com/liveupdate/scorestrip/ss.xml");
XmlData = doc1.InnerXml;
}
}
But this won't work because I want to use AJAX to grab the XML data so that I don't have to do a full page refresh.