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
46faa038
Commit
46faa038
authored
Nov 20, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #407, yet to be tested
parent
7cc55072
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
ajax.js
src/ajax/ajax.js
+13
-5
ajaxTest.js
src/ajax/ajaxTest.js
+1
-1
No files found.
src/ajax/ajax.js
View file @
46faa038
...
...
@@ -122,7 +122,7 @@ jQuery.fn.extend({
return
this
.
find
(
'script'
).
each
(
function
(){
if
(
this
.
src
)
// for some weird reason, it doesn't work if the callback is ommited
jQuery
.
getScript
(
this
.
src
,
function
()
{}
);
jQuery
.
getScript
(
this
.
src
);
else
eval
.
call
(
window
,
this
.
text
||
this
.
textContent
||
this
.
innerHTML
||
""
);
}).
end
();
...
...
@@ -581,9 +581,12 @@ jQuery.extend({
if
(
s
.
ifModified
&&
modRes
)
jQuery
.
lastModified
[
s
.
url
]
=
modRes
;
// If a local callback was specified, fire it
// process the data (runs the xml through httpData regardless of callback)
var
data
=
jQuery
.
httpData
(
xml
,
s
.
dataType
);
// If a local callback was specified, fire it and pass it the data
if
(
s
.
success
)
s
.
success
(
jQuery
.
httpData
(
xml
,
s
.
dataType
)
,
status
);
s
.
success
(
data
,
status
);
// Fire the global callback
if
(
s
.
global
)
...
...
@@ -678,8 +681,13 @@ jQuery.extend({
var
data
=
!
type
&&
ct
&&
ct
.
indexOf
(
"xml"
)
>=
0
;
data
=
type
==
"xml"
||
data
?
r
.
responseXML
:
r
.
responseText
;
// If the type is "script", eval it
if
(
type
==
"script"
)
eval
.
call
(
window
,
data
);
// If the type is "script", eval it´in global context
if
(
type
==
"script"
)
{
if
(
window
.
execScript
)
window
.
execScript
(
data
);
else
window
.
setTimeout
(
data
,
0
);
}
// Get the JavaScript object, if JSON is used.
if
(
type
==
"json"
)
eval
(
"data = "
+
data
);
...
...
src/ajax/ajaxTest.js
View file @
46faa038
...
...
@@ -119,7 +119,7 @@ test("$.getScript(String, Function) - with callback", function() {
stop
();
$
.
getScript
(
"data/test.js"
,
function
()
{
ok
(
foobar
==
"bar"
,
'Check if script was evaluated'
);
s
tart
(
);
s
etTimeout
(
start
,
100
);
});
});
...
...
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