我正在使用 Zend 框架版本 1.11.3 和 jquery 移动版本 1.3.0-beta.1。我的滑动和注册不能同时工作。个别他们工作正常。我尝试改变他们的位置,但都是徒劳的。这是我的代码 - 注册表单代码:
<script>
$('#1').on('pageshow', function(event) {
$(document).on('click','#submit_button',function(e) {
if (validatefName() & validatelName() & validateEmail()) {
$.ajax({
errorElement : "em",
type : "POST",
url : "index/saveregister",
data : $('#registerForm').serialize(),
success : function(e) {
// e is for detecting if the meail address already exists in the database.
if (e == 1) {
console.log("success");
//location.reload();
$("#message").html('<h2 style="color:green"><center><br>Thank you for registering with us .</center></h2>');
}
if (e == 0) {
// If email address exists in the database already
//alert("e is zero");
$('#message').html('<h2 style="color:red">Please check ur email address</h2>');
return false;
}
},
error : function(data1, st, rr) {
alert("ajax error");
}
});
//ajax requests
return true;
} else {
return false;
}
});
});
</script>
扫码:
$( document ).on( "pageinit", "[data-role='page'].swipe-page", function() {
var page = "#" + $( this ).attr( "id" ),
next = $( this ).jqmData( "next" ),
prev = $( this ).jqmData( "prev" );
if ( next ) {
// Prefetch the next page
$.mobile.loadPage( next );
// Navigate to next page on swipe left
$( document ).on( "swipeleft", page, function() {
$.mobile.changePage( next );
});
}
if ( prev ) {
$( document ).on( "swiperight", page, function() {
$.mobile.changePage( prev , { reverse: true } );
});
}
});
任何帮助将不胜感激