Redirect to different domain URL (google app engine logout) doesn't work from silverlight + javascript
I see the following behavior:
When I call javascript XMLHttpRequest/open/send from silverlight, for a URL that eventually causes HTTP redirect to a different domain (logout URL in google app engine), than the silverlight application was loaded fro开发者_运维技巧m, the browser doesn't follow the redirect.
When I go to the same URL either manually from the browser, or using a link on the same page where the silverlight application is, everything work fine - the browser follows redirect correctly.
Does anyone know the cause for such difference in behavior / is there any workaround / configuration to avoid it?
Thanks!
The XMLHttpRequest will block cross domain requests. Even if the initial request is to the same domain as the current document any redirection coming back must also be within the same domain.
Your problem is not specific to SL. In general, XMLHttpRequest
is used for making AJAX calls ("background" HTTP requests) that do not cause browser navigations.
If you want to cause browser navigation, instead of using XMLHttpRequest
to the logout URL, you should change the current window location (through the window.location
object).
精彩评论