当我通过ajax发布我有时会得到额外的字符发布例如。如果文本通过AJAX虽然哟PHP $ _POST我最终得到:jquery发布错误文本时,发布与ajax
这是我messagejQuery127638276487364873268_374632874687326487的职位虽然经过精细的时间
99%......我不知道该如何捕获并移除此错误,因为它只发生在某些时间。
// this is the ajax that we need to post the footprint to the wall.
$('#submitbutton').click(function() {
var footPrint = $('#footPrint').val();
var goUserId = '1';
$.ajax({
type: 'POST',
url: '/scripts/ajax-ProfileObjects.php',
data: 'do=leave_footprint&footPrint=' + footPrint + '&ref=' + goUserId + '&json=1',
dataType: 'json',
success: function(data){
var textError = data.error;
var textAction = data.action;
var textList = data.list;
if (textError == 'post_twice' || textError =='footprint_empty' || textError == 'login_req') {
// display the error.
} else {
// lets fade out the item and update the page.
}
});
return false; });
您需要发布您的代码或示例才能获得答案。 – j08691 2012-03-24 19:54:54