Hi,
This is the first time ever I'm using AJAX, and I want to do the following on an otherwise static page www.xyz.org/some_site.html:
- Send a GET request to another url
"www.xyz.org/testscript"
- if response has either
status code != 200
orcontent != 'ok'
: do nothing - else: include sth on the website (i.e. set
style="display:block"
on an element that previously had"display:none"
)
I've implemented that successfully using basic AJAX. But:
There is an Apache redirect installed pointing from www.xyz.org/testscript
to subdomain.xyz.org/testscript
, the URL where the actual testscript lives (as AJAX doesn't support cross-domain calls even to subdomains afaik).
When I call www.xyz.org/testscript I get a 302
status code, and the content says "The document has moved here: subdomain.xyz.org/testscript".
How can I grab the 'final' return value?
I guess/hope any AJAX expert can give me a one-liner to solve that ...