Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
1ad874f3
Commit
1ad874f3
authored
Jan 09, 2013
by
jaubourg
Committed by
Dave Methvin
Jan 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further script transport cleanup, close gh-1123.
parent
c373a499
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
script.js
src/ajax/script.js
+16
-19
No files found.
src/ajax/script.js
View file @
1ad874f3
...
@@ -25,30 +25,27 @@ jQuery.ajaxPrefilter( "script", function( s ) {
...
@@ -25,30 +25,27 @@ jQuery.ajaxPrefilter( "script", function( s ) {
});
});
// Bind script tag hack transport
// Bind script tag hack transport
jQuery
.
ajaxTransport
(
"script"
,
function
(
s
)
{
jQuery
.
ajaxTransport
(
"script"
,
function
(
s
)
{
// This transport only deals with cross domain requests
// This transport only deals with cross domain requests
if
(
s
.
crossDomain
)
{
if
(
s
.
crossDomain
)
{
var
callback
;
var
script
,
callback
;
return
{
return
{
send
:
function
(
_
,
complete
)
{
send
:
function
(
_
,
complete
)
{
callback
=
function
(
type
)
{
script
=
jQuery
(
"<script>"
).
prop
({
return
function
()
{
callback
=
script
.
onload
=
script
.
onerror
=
null
;
jQuery
(
script
).
remove
();
if
(
type
)
{
complete
(
type
===
"success"
?
200
:
404
,
type
);
}
};
};
var
script
=
jQuery
.
extend
(
document
.
createElement
(
"script"
),
{
async
:
true
,
async
:
true
,
charset
:
s
.
scriptCharset
,
charset
:
s
.
scriptCharset
,
src
:
s
.
url
,
src
:
s
.
url
onload
:
callback
(
"success"
),
}).
on
(
onerror
:
callback
(
"error"
)
"load error"
,
});
callback
=
function
(
evt
)
{
callback
=
callback
();
script
.
off
().
remove
();
document
.
head
.
appendChild
(
script
);
callback
=
null
;
if
(
evt
)
{
complete
(
evt
.
type
===
"error"
?
404
:
200
,
evt
.
type
);
}
}
);
document
.
head
.
appendChild
(
script
[
0
]
);
},
},
abort
:
function
()
{
abort
:
function
()
{
if
(
callback
)
{
if
(
callback
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment