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
39c05d36
Commit
39c05d36
authored
Dec 02, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed jQuery.eval (or rather, jQuery.globalEval to avoid problems with FF)
parent
ef1ee513
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
ajax.js
src/ajax/ajax.js
+12
-4
No files found.
src/ajax/ajax.js
View file @
39c05d36
...
...
@@ -124,7 +124,7 @@ jQuery.fn.extend({
// for some weird reason, it doesn't work if the callback is ommited
jQuery
.
getScript
(
this
.
src
);
else
{
jQuery
.
eval
(
this
.
text
||
this
.
textContent
||
this
.
innerHTML
||
""
);
jQuery
.
globalEval
(
this
.
text
||
this
.
textContent
||
this
.
innerHTML
||
""
);
}
}).
end
();
}
...
...
@@ -304,6 +304,10 @@ jQuery.extend({
* Loads, and executes, a remote JavaScript file using an HTTP GET request.
* All of the arguments to the method (except URL) are optional.
*
* Warning: Safari <= 2.0.x is unable to evalulate scripts in a global
* context sychronously. If you load functions via getScript, make sure
* to call them after a delay.
*
* @example $.getScript("test.js")
*
* @example $.getScript("test.js", function(){
...
...
@@ -684,7 +688,7 @@ jQuery.extend({
// If the type is "script", eval it in global context
if
(
type
==
"script"
)
{
jQuery
.
e
val
(
data
);
jQuery
.
globalE
val
(
data
);
}
// Get the JavaScript object, if JSON is used.
...
...
@@ -727,10 +731,14 @@ jQuery.extend({
return
s
.
join
(
"&"
);
},
// TODO document me
eval
:
function
(
data
)
{
// evalulates a script in global context
// not reliable for safari
globalEval
:
function
(
data
)
{
if
(
window
.
execScript
)
window
.
execScript
(
data
);
else
if
(
jQuery
.
browser
.
safari
)
// safari doesn't provide a synchronous global eval
window
.
setTimeout
(
data
,
0
);
else
eval
.
call
(
window
,
data
);
}
...
...
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