javascript - all relative URLs get converted into absolute -


this issue exists in chrome , firefox not ie.

i have angular app. once view loaded, xhr requests made relative paths converted requests absolute path.

example:

i navigate http://example.com/foo/#/bar

in chrome dev tools type:

var xhr = new xmlhttprequest(); xhr.open("get", "ping", true);//or "./ping" xhr.send(); 

the result 404 error , network tab shows request made http://example.com/ping instead of http://example.com/foo/ping.

what can possibly cause behavior?

turned out rogue <base href="/"> tag.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -