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
3386923d
Commit
3386923d
authored
May 17, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some bugs in the serialization code, it seems to work now.
parent
f1c8b3ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
24 deletions
+16
-24
ajax.js
ajax/ajax.js
+16
-24
No files found.
ajax/ajax.js
View file @
3386923d
...
@@ -145,27 +145,22 @@ $.fn.load = function(a,o,f) {
...
@@ -145,27 +145,22 @@ $.fn.load = function(a,o,f) {
*/
*/
$
.
fn
.
formValues
=
function
()
{
$
.
fn
.
formValues
=
function
()
{
var
a
=
[];
var
a
=
[];
this
.
find
(
"input,textarea,option"
)
$
(
"input,textarea,option"
,
this
).
filter
(
":enabled"
).
each
(
function
(){
.
filter
(
":enabled"
)
// Skip selects with options which are not selected
.
each
(
function
()
{
if
((
this
.
parentNode
.
type
==
'select-one'
||
this
.
parentNode
.
type
==
'select-multiple'
)
&&
!
this
.
selected
)
{
//
return
null
;
// Skip selects with options which aren't selected
}
if
(((
this
.
parentNode
.
type
==
'select-one'
)
||
(
this
.
parentNode
.
type
==
'select-multiple'
))
&&
(
!
this
.
selected
))
return
;
//
// Skip radio and checkbox elements which are not checked
// Skip radio and checkbox elements which aren't checked
if
((
this
.
type
==
'radio'
||
this
.
type
==
'checkbox'
)
&&
!
this
.
checked
)
{
if
(((
this
.
type
==
'radio'
)
||
(
this
.
type
==
'checkbox'
))
&&
return
null
;
(
!
this
.
checked
))
}
return
;
//
// All other elements are valid
// All other elements are valid ;)
a
.
push
({
var
o
=
{};
name
:
this
.
name
||
this
.
id
||
this
.
parentNode
.
name
||
this
.
parentNode
.
id
,
o
.
name
=
this
.
name
||
this
.
id
||
this
.
parentNode
.
name
||
this
.
parentNode
.
id
;
value
:
this
.
value
o
.
value
=
this
.
value
;
});
a
.
push
(
o
);
});
});
return
a
;
return
a
;
};
};
...
@@ -179,11 +174,9 @@ $.fn.formValues = function() {
...
@@ -179,11 +174,9 @@ $.fn.formValues = function() {
*/
*/
$
.
update
=
function
(
objElement
,
strURL
,
arrValues
,
fncCallback
)
{
$
.
update
=
function
(
objElement
,
strURL
,
arrValues
,
fncCallback
)
{
$
.
post
(
strURL
,
arrValues
,
function
(
strHTML
)
{
$
.
post
(
strURL
,
arrValues
,
function
(
strHTML
)
{
//
// Update the element with the new HTML
// Update the element with the new HTML
objElement
.
html
(
strHTML
);
objElement
.
html
(
strHTML
);
//
// Evaluate the scripts
// Evaluate the scripts
objElement
.
html
(
strHTML
).
find
(
"script"
).
each
(
function
(){
objElement
.
html
(
strHTML
).
find
(
"script"
).
each
(
function
(){
try
{
try
{
...
@@ -191,7 +184,6 @@ $.update = function(objElement, strURL, arrValues, fncCallback) {
...
@@ -191,7 +184,6 @@ $.update = function(objElement, strURL, arrValues, fncCallback) {
}
catch
(
e
)
{
}
}
catch
(
e
)
{
}
});
});
//
// Callback handler
// Callback handler
if
(
fncCallback
)
{
fncCallback
();
}
if
(
fncCallback
)
{
fncCallback
();
}
});
});
...
...
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