Im trying to make an ajax call using an absolute url. But the url is automatically being prepended with the current domain and hence giving me a 404. How can I stop the current domain from prepending to the URL.
$.ajax({ type: "GET", url: "www.xxxx.org" + path + ".zzzz.json",
.
.
// rest of the code }
here path is /etc/xxx/yyy/etc
The error I'm getting is: GET http://yyyyy.xxx.org/www.xxx.org/etc/xxx/yyy/zzzz.json 404.
If anyone has any idea about solving this problem, please help. Thank you.
URLs without a leading scheme are treated as relative URLs from the origin of current page. (This is the same behavior for the values in <a href="..."
> links.)
You must use a scheme, e.g., http://www.xxxx.com/...
instead of www.xxxx.com/...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With