-1
我的代码看起来像这样的时刻:
$("button").click(function(){
var id = ($(this).val());
$.post('ajax.php', {id: id}, function(data){
alert(data);
});
});
ajax.php
<?php echo 'HELLO!'; ?>
但它不工作。我现在很困难。你能看到$.post
中的任何错误吗?我99%肯定有什么不对。
做到这一点 - > ** HTTP://jsfiddle.net/adeneo/5gYf3/**,并告诉我们控制台说什么。 – adeneo
这段代码工作正常,因为这-1 – Anri
@adeneo,我更喜欢'console.log(参数);''1.'只有一行,'''''''不需要声明/知道参数编号... –