Opened 15 years ago
Closed 15 years ago
#1750 closed enhancement (fixed)
getScript fails with scheme-less urls
Reported by: | mbaierl | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | ajax | Version: | 1.2.1 |
Keywords: | scheme, script, ajax | Cc: | |
Blocked by: | Blocking: |
Description
Calling
$.getScript("//www.server.com/script.js");
fails with an XMLHTTP Cross-Domain exception. The reason lies in the function ajax, line 2259:
if ( !s.url.indexOf("http") && s.dataType == "script" ) {
This just checks for http(s) in the beginning, leaving out scheme-less URLs.
The fix is to change this line to be
if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && s.dataType == "script" ) {
This also covers scheme-less URLs.
There might be other places in jQuery that have the same problem.
Change History (3)
comment:1 Changed 15 years ago by
Component: | core → ajax |
---|
comment:2 Changed 15 years ago by
comment:3 Changed 15 years ago by
Milestone: | 1.2.1 → 1.2.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Type: | bug → enhancement |
Fixed in [4123] using the solution the author suggested.
Note: See
TracTickets for help on using
tickets.
This bug is now 2 month old, will anything happen here? This is a sever show-stopper if a page has to work independent of the protocol...