確かに単純なものが欠けています...以下は、PHPスクリプトに送信しようとしている単純なフォームです。PC と Mac では正常に動作しますが、iPad や iPhone などの Safari では動作しません。モバイル コンポーネントが不足していると思いますか?
<html>
<head>
<title>Title</title>
<script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
<script type="text/javascript">
$('form').submit(function(){
var postData = $(this).serialize();
$.ajax({
type: 'POST',
data: postData,
url: "http://www.norwichandyork.com/pocketleads/utilities/accounts.php",
success: function(data){
console.log(data);
alert('Your comment was successfully added');
},
error: function(){
console.log(data);
alert('There was an error adding your comment');
}
});
return false;
});
</script>
</head>
<body>
<form method="post" action="http://www.norwichandyork.com/pocketleads/utilities/accounts.php">
<label for="email">
<b>Email</b>
<input type="text" id="email" name="email">
</label>
<label for="fname">
<b>fname</b>
<input type="text" id="fname" name="fname">
</label>
<input type="submit" value="Save">
</form>
</body>
</html>
誰でも簡単に試すことができるように、完全なコードを再投稿し、アクションの URL を残しました。ご協力いただきありがとうございます。:)