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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -