Side navigation
#6034 closed bug (invalid)
Opened February 04, 2010 10:03PM UTC
Closed February 05, 2010 07:56PM UTC
Last modified February 05, 2010 08:43PM UTC
getScript doesn't always respect the base tag
Reported by: | bhasden | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4.2 |
Component: | ajax | Version: | 1.4.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I've got a website with the <base> tag defined as the website root directory, for example: http://www.example.com/myWebsite/.
In IE8 when I use $.getScript('path/to/script.js') jQuery appropriately requests and loads http://www.example.com/myWebsite/path/to/script.js no matter where the current page is located in the website.
On the other hand, in FF 3.5.7 the request for 'path/to/script.js' is relative to the current page. For example if I'm viewing http://www.example.com/myWebsite/post/345/ the getScript call will request http://www.example.com/myWebsite/post/345/path/to/script.js.
I understand this may not be a bug with jQuery but since jQuery usualy insulates me from these sort of issues it would be nice if jQuery found a way of forcing getScript to behave one way or the other.
Attachments (1)
Change History (2)
Changed February 05, 2010 07:56PM UTC by comment:1
component: | unfilled → ajax |
---|---|
resolution: | → invalid |
status: | new → closed |
Changed February 05, 2010 08:43PM UTC by comment:2
Is there any way jQuery could be updated to pull the base tag href before making the XHR so that it could pull together the absolute url if a base tag exists? I know this isn't the most pressing issue in the world but it's really annoying that the behavior is different between the two major browsers, especially since jQuery is designed to provide consistent cross-browser behavior.
Do you have a simple test page that we can look at? We're just using the native XMLHttpRequest here so figuring out the difference would be ideal.