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
03de2cb5
Commit
03de2cb5
authored
Jul 19, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved some RegExp in core.js, goes toward #4111.
parent
eaca153a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
core.js
src/core.js
+8
-2
No files found.
src/core.js
View file @
03de2cb5
...
@@ -25,6 +25,12 @@ var jQuery = function( selector, context ) {
...
@@ -25,6 +25,12 @@ var jQuery = function( selector, context ) {
// Is it a simple selector
// Is it a simple selector
isSimple
=
/^.
[^
:#
\[\.
,
]
*$/
,
isSimple
=
/^.
[^
:#
\[\.
,
]
*$/
,
// Check if a string has a non-whitespace character in it
rnotwhite
=
/
\S
/
,
// Used for trimming whitespace
rtrim
=
/^
\s
+|
\s
+$/g
,
// Keep a UserAgent string for use with jQuery.browser
// Keep a UserAgent string for use with jQuery.browser
userAgent
=
navigator
.
userAgent
.
toLowerCase
(),
userAgent
=
navigator
.
userAgent
.
toLowerCase
(),
...
@@ -303,7 +309,7 @@ jQuery.extend({
...
@@ -303,7 +309,7 @@ jQuery.extend({
// Evalulates a script in a global context
// Evalulates a script in a global context
globalEval
:
function
(
data
)
{
globalEval
:
function
(
data
)
{
if
(
data
&&
/
\S
/
.
test
(
data
)
)
{
if
(
data
&&
rnotwhite
.
test
(
data
)
)
{
// Inspired by code by Andrea Giammarchi
// Inspired by code by Andrea Giammarchi
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
var
head
=
document
.
getElementsByTagName
(
"head"
)[
0
]
||
document
.
documentElement
,
var
head
=
document
.
getElementsByTagName
(
"head"
)[
0
]
||
document
.
documentElement
,
...
@@ -366,7 +372,7 @@ jQuery.extend({
...
@@ -366,7 +372,7 @@ jQuery.extend({
},
},
trim
:
function
(
text
)
{
trim
:
function
(
text
)
{
return
(
text
||
""
).
replace
(
/^
\s
+|
\s
+$/g
,
""
);
return
(
text
||
""
).
replace
(
rtrim
,
""
);
},
},
makeArray
:
function
(
array
)
{
makeArray
:
function
(
array
)
{
...
...
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