D&Dのキャラクター情報を更新しているサイトをやっています。この特定のページには、編集可能な div があり、変更を加えて (非常に一貫性のない) ajax POST スクリプトを介して送信します。
どういうわけか、POST は変更を送信しません。完全にランダムである可能性があります。機能してDBを更新する場合と、そうでない場合があります。もちろん、皆さんが私のサーバーに POST を作成することは不可能ですが、ajax は次のとおりです。
<script type="text/javascript">
$(document).ready(function() {
$("#actor_result").load('xml/actortoxml.php?owner=cederman&id=2');
$('#save_editable').click(function() {
var name = $(document).find('#actorname').text();
var current = $(document).find('#currenthealth').text();
var max = $(document).find('#maxhealth').text();
var effects = $(document).find('#actoreffects').text();
var notes = $(document).find('#actornotes').text();
$.ajax({
url: 'actor_profile.php',
type: 'POST',
data: {
update: 'true',
actorid: 2,
actorname: name, currenthealth: current, maxhealth: max, actoreffects: effects, actornotes: notes
},
});
window.location = 'actor_profile.php?id=2'
});
/*
var refreshId = setInterval(function() {
$("#actor_result").load('xml/actortoxml.php?owner=cederman&id=2');
}, 300000);
$.ajaxSetup({ cache: false });
*/
});
</script>
ここでフィドルを確認してください: http://jsfiddle.net/CgLmW/2/