Reading server-side XML with JavaScript and jQuery
this is quite a simple question hopefully.
Our client currently has a Flash banner ad on their site which they can change the text size, colour, position etc. by editing an XML file. They want to scrap flash and use JavaScript and jQuery. Now, as long as the XML file开发者_如何学C is at a readable URL I should be able make an AJAX request for the file and use it. Is that correct?
Many thanks
Yes.
http://api.jquery.com/jQuery.get/
EDIT:
Of course I forgot about the same origin policy: http://en.wikipedia.org/wiki/Same_origin_policy
Yes … and No: The URI must be on the same host (and port, etc, etc) or run into the Same Origin Policy.
精彩评论