所有我正在做的是点击按钮时从输入中获取值:
var input = $('#input').val();
var data = {
data : input
};
$.ajax({
type: 'POST',
url: 'index.php',
data: data,
dataType: 'text',
succes: function(response){alert(response);},
error: function(){alert("something went wrong");} });
});
Run Code Online (Sandbox Code Playgroud)
});
我的index.php只是:echo'apple'; ,但是当我点击按钮时,它什么都不做.
| 归档时间: |
|
| 查看次数: |
46 次 |
| 最近记录: |