RuijieRa / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE. Loading from External XML file #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

I'm trying to load from a XML file by giving the full URL. I need to do
this due to the server redirects I have in place on my site, meaning
linking to the relative path e.g. "("example.xml", function...etc)" is not
practical

Example of what I want to achieve:

  Timeline.loadXML("http://cms.example.com/templates/xml/example1.xml",
function(xml, url) { eventSource.loadXML(xml, url); });

Doing this makes the javascript break, I have placed a javascript alert as
a test after this XML call and it doesn't get triggered. We assumed that we
needed to escape the forward slashes with backlashes, but this did not work.

Any ideas as to why this is? 

XP, Firefox3 and IE7 

[Submitted by Carl Fernandes on simile.mit.edu] 

Original issue reported on code.google.com by GabrielR...@googlemail.com on 14 Apr 2009 at 12:15

GoogleCodeExporter commented 9 years ago
The Browser "same origin policy" security feature requires that Ajax calls must 
go to
the same domain and protocol as the html file itself. So you should use 
relative url
references. See http://en.wikipedia.org/wiki/Same_origin_policy for more 
information.

When you violate the policy, you get the behavior you've described.

Regards,

Larry

Original comment by larryklu...@gmail.com on 14 Apr 2009 at 2:35