Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
mui
Commits
337bd52e
Commit
337bd52e
authored
Nov 12, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决ajax传递中文参数乱码问题
parent
8a51beaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
32 deletions
+52
-32
dist/js/mui.js
dist/js/mui.js
+42
-26
dist/js/mui.min.js
dist/js/mui.min.js
+4
-4
examples/hello-mui/examples/ajax.html
examples/hello-mui/examples/ajax.html
+6
-2
No files found.
dist/js/mui.js
View file @
337bd52e
/*!
* =====================================================
* Mui v0.
6
.0 (https://github.com/dcloudio/mui)
* Mui v0.
7
.0 (https://github.com/dcloudio/mui)
* =====================================================
*/
/**
...
...
@@ -1419,7 +1419,7 @@ var mui = (function(document, undefined) {
if
(
!
options
.
preload
)
{
options
.
preload
=
true
;
}
$
.
createWindow
(
options
);
return
$
.
createWindow
(
options
);
}
/**
...
...
@@ -1687,7 +1687,7 @@ var mui = (function(document, undefined) {
var
options
=
$
.
options
;
var
pullRefreshOptions
=
options
.
pullRefresh
||
{};
if
(
pullRefreshOptions
.
down
&&
pullRefreshOptions
.
down
.
hasOwnProperty
(
'
callback
'
)
||
pullRefreshOptions
.
up
&&
pullRefreshOptions
.
up
.
hasOwnProperty
(
'
callback
'
))
{
if
(
(
pullRefreshOptions
.
down
&&
pullRefreshOptions
.
down
.
hasOwnProperty
(
'
callback
'
))
||
(
pullRefreshOptions
.
up
&&
pullRefreshOptions
.
up
.
hasOwnProperty
(
'
callback
'
)
))
{
var
container
=
pullRefreshOptions
.
container
;
if
(
container
)
{
var
$container
=
$
(
container
);
...
...
@@ -1745,7 +1745,7 @@ var mui = (function(document, undefined) {
ajaxComplete
(
'
success
'
,
xhr
,
settings
);
};
// type: "timeout", "error", "abort", "parsererror"
var
ajaxError
=
function
(
error
,
type
,
xhr
,
settings
,
deferred
)
{
var
ajaxError
=
function
(
error
,
type
,
xhr
,
settings
)
{
settings
.
error
.
call
(
settings
.
context
,
xhr
,
type
,
error
);
ajaxComplete
(
type
,
xhr
,
settings
);
};
...
...
@@ -1901,7 +1901,7 @@ var mui = (function(document, undefined) {
abortTimeout
=
setTimeout
(
function
()
{
xhr
.
onreadystatechange
=
$
.
noop
;
xhr
.
abort
();
ajaxError
(
null
,
'
timeout
'
,
xhr
,
settings
,
deferred
)
ajaxError
(
null
,
'
timeout
'
,
xhr
,
settings
);
},
settings
.
timeout
);
}
xhr
.
send
(
settings
.
data
?
settings
.
data
:
null
);
...
...
@@ -1912,7 +1912,7 @@ var mui = (function(document, undefined) {
$
.
param
=
function
(
obj
,
traditional
)
{
var
params
=
[];
params
.
add
=
function
(
k
,
v
)
{
this
.
push
(
e
scape
(
k
)
+
'
=
'
+
escape
(
v
));
this
.
push
(
e
ncodeURIComponent
(
k
)
+
'
=
'
+
encodeURIComponent
(
v
));
};
serialize
(
params
,
obj
,
traditional
);
return
params
.
join
(
'
&
'
).
replace
(
/%20/g
,
'
+
'
);
...
...
@@ -2102,7 +2102,7 @@ var mui = (function(document, undefined) {
momentum
:
true
,
bounce
:
true
,
bounceTime
:
6
00
,
bounceTime
:
3
00
,
bounceEasing
:
ease
.
circular
.
style
,
directionLockThreshold
:
5
,
...
...
@@ -2114,8 +2114,10 @@ var mui = (function(document, undefined) {
this
.
translateZ
=
this
.
options
.
hardwareAccelerated
?
'
translateZ(0)
'
:
''
;
this
.
_init
();
this
.
refresh
();
this
.
scrollTo
(
this
.
options
.
startX
,
this
.
options
.
startY
);
if
(
this
.
scroller
)
{
this
.
refresh
();
this
.
scrollTo
(
this
.
options
.
startX
,
this
.
options
.
startY
);
}
},
_init
:
function
()
{
this
.
_initIndicators
();
...
...
@@ -2246,8 +2248,19 @@ var mui = (function(document, undefined) {
},
_drag
:
function
(
e
)
{
var
detail
=
e
.
detail
;
detail
.
gesture
&&
detail
.
gesture
.
preventDefault
();
var
isPreventDefault
=
false
;
if
(
detail
.
direction
===
'
left
'
||
detail
.
direction
===
'
right
'
)
{
if
(
this
.
options
.
scrollX
)
{
isPreventDefault
=
true
;
}
}
else
if
(
detail
.
direction
===
'
up
'
||
detail
.
direction
===
'
down
'
)
{
if
(
this
.
options
.
scrollY
)
{
isPreventDefault
=
true
;
}
}
if
(
isPreventDefault
)
{
detail
.
gesture
&&
detail
.
gesture
.
preventDefault
();
}
var
deltaX
=
detail
.
deltaX
-
detail
.
lastDeltaX
;
var
deltaY
=
detail
.
deltaY
-
detail
.
lastDeltaY
;
var
absDeltaX
=
Math
.
abs
(
detail
.
deltaX
);
...
...
@@ -2974,19 +2987,21 @@ var mui = (function(document, undefined) {
},
_init
:
function
()
{
this
.
scroller
=
this
.
wrapper
.
querySelector
(
'
.
'
+
CLASS_SLIDER_GROUP
);
this
.
scrollerStyle
=
this
.
scroller
.
style
;
this
.
progressBar
=
this
.
wrapper
.
querySelector
(
SELECTOR_SLIDER_PROGRESS_BAR
);
if
(
this
.
progressBar
)
{
this
.
progressBarWidth
=
this
.
progressBar
.
offsetWidth
;
this
.
progressBarStyle
=
this
.
progressBar
.
style
;
}
if
(
this
.
scroller
)
{
this
.
scrollerStyle
=
this
.
scroller
.
style
;
this
.
progressBar
=
this
.
wrapper
.
querySelector
(
SELECTOR_SLIDER_PROGRESS_BAR
);
if
(
this
.
progressBar
)
{
this
.
progressBarWidth
=
this
.
progressBar
.
offsetWidth
;
this
.
progressBarStyle
=
this
.
progressBar
.
style
;
}
this
.
x
=
this
.
_getScroll
();
if
(
this
.
options
.
startX
===
false
)
{
this
.
options
.
startX
=
this
.
x
;
this
.
x
=
this
.
_getScroll
();
if
(
this
.
options
.
startX
===
false
)
{
this
.
options
.
startX
=
this
.
x
;
}
this
.
_super
();
this
.
_initTimer
();
}
this
.
_super
();
this
.
_initTimer
();
},
_initEvent
:
function
()
{
var
self
=
this
;
...
...
@@ -3688,7 +3703,8 @@ var mui = (function(document, undefined) {
name
:
name
,
index
:
50
,
handle
:
handle
,
target
:
false
target
:
false
,
isContinue
:
true
});
})(
mui
,
window
,
document
,
'
action
'
);
...
...
@@ -4579,7 +4595,7 @@ var mui = (function(document, undefined) {
})(
mui
,
window
);
(
function
(
$
,
window
)
{
/**
*
警告
消息框
*
确认
消息框
*/
$
.
confirm
=
function
(
message
,
title
,
btnArray
,
callback
)
{
if
(
$
.
os
.
plus
)
{
...
...
@@ -4606,7 +4622,7 @@ var mui = (function(document, undefined) {
})(
mui
,
window
);
(
function
(
$
,
window
)
{
/**
*
警告消息
框
*
输入对话
框
*/
$
.
prompt
=
function
(
text
,
defaultText
,
title
,
btnArray
,
callback
)
{
if
(
$
.
os
.
plus
)
{
...
...
@@ -4639,7 +4655,7 @@ var mui = (function(document, undefined) {
})(
mui
,
window
);
(
function
(
$
,
window
)
{
/**
*
toast
*
自动消失提示框
*/
$
.
toast
=
function
(
message
)
{
if
(
$
.
os
.
plus
&&
$
.
os
.
android
){
...
...
dist/js/mui.min.js
View file @
337bd52e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
examples/hello-mui/examples/ajax.html
View file @
337bd52e
...
...
@@ -21,6 +21,9 @@
.mui-bar-nav
~
.mui-content
{
padding
:
0
;
}
.mui-content-padded
{
padding
:
10px
;
}
</style>
<script>
mui
.
init
();
...
...
@@ -49,7 +52,7 @@
<div
class=
"mui-content"
>
<div
class=
"mui-content-padded"
style=
"padding-bottom: 50px;"
>
<p
style=
"text-indent: 22px;
padding: 10px;
"
>
<p
style=
"text-indent: 22px;"
>
mui基于html5plus的
<a
href=
"http://www.dcloud.io/docs/api/zh_cn/xhr.shtml"
>
XMLHttpRequest
</a>
,封装了常用的ajax函数,支持Get、Post请求方式, 支持返回json、xml、html、text、script数据类型;本示例使用
<a
href=
"http://www.oschina.net/question/82993_78609"
>
RunJS
</a>
的Echo Ajax功能演示网络请求。
</p>
<h4
class=
"mui-content-padded"
>
发送请求:
</h4>
...
...
@@ -103,7 +106,8 @@
var
data
=
{
name
:
"
mui
"
,
version
:
"
pre-release
"
,
author
:
"
chb
"
author
:
"
chb
"
,
description
:
"
最接近原生APP体验的高性能前端框架
"
};
url
=
url
+
(
dataType
===
'
html
'
?
'
text
'
:
dataType
);
respnoseEl
.
innerHTML
=
'
正在请求中...
'
;
...
...
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