我有一个页面说,a.php。在页面中,单击按钮时,我调用了函数“sample”。
<script type="text/javascript">
function sample(id,no) {
jQuery.post('s.php', { ID: id, Number: no }, function(response) {
window.self.location='s.php'
});
}
</script>
<input name="" value="submit" type="button" onClick="return sample('5','10');">
我需要将值发布到 s.php。
我上面的代码可以吗?