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
18e33074
Commit
18e33074
authored
Dec 15, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced the rest of the x.constructor != String comparions with typeof (Thanks Kelvin)
parent
3e165ae5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
jquery.js
src/jquery/jquery.js
+3
-3
No files found.
src/jquery/jquery.js
View file @
18e33074
...
@@ -390,7 +390,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -390,7 +390,7 @@ jQuery.fn = jQuery.prototype = {
*/
*/
attr
:
function
(
key
,
value
,
type
)
{
attr
:
function
(
key
,
value
,
type
)
{
// Check to see if we're setting style values
// Check to see if we're setting style values
return
key
.
constructor
!=
String
||
value
!=
undefined
?
return
typeof
key
!=
"string"
||
value
!=
undefined
?
this
.
each
(
function
(){
this
.
each
(
function
(){
// See if we're setting a hash of styles
// See if we're setting a hash of styles
if
(
value
==
undefined
)
if
(
value
==
undefined
)
...
@@ -1456,7 +1456,7 @@ jQuery.extend({
...
@@ -1456,7 +1456,7 @@ jQuery.extend({
// Set the correct context (if none is provided)
// Set the correct context (if none is provided)
context
=
context
||
document
;
context
=
context
||
document
;
if
(
t
.
constructor
!=
String
)
return
[
t
];
if
(
t
ypeof
t
!=
"string"
)
return
[
t
];
if
(
!
t
.
indexOf
(
"//"
)
)
{
if
(
!
t
.
indexOf
(
"//"
)
)
{
context
=
context
.
documentElement
;
context
=
context
.
documentElement
;
...
@@ -1645,7 +1645,7 @@ jQuery.extend({
...
@@ -1645,7 +1645,7 @@ jQuery.extend({
// Otherwise, find the expression to execute
// Otherwise, find the expression to execute
else
{
else
{
var
f
=
jQuery
.
expr
[
m
[
1
]];
var
f
=
jQuery
.
expr
[
m
[
1
]];
if
(
f
.
constructor
!=
String
)
if
(
typeof
f
!=
"string"
)
f
=
jQuery
.
expr
[
m
[
1
]][
m
[
2
]];
f
=
jQuery
.
expr
[
m
[
1
]][
m
[
2
]];
// Build a custom macro to enclose it
// Build a custom macro to enclose it
...
...
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