Home > php教程 > php手册 > js 向php页面传值,$.post不执行??

js 向php页面传值,$.post不执行??

WBOY
Release: 2016-06-06 19:41:47
Original
931 people have browsed it

代码如下: button class="button_1" id="save_btn" ontouchstart="" onclick="save()" 报名/button script type="text/javascript" function save(){ alert ("77"); var _nick=_._trim($("dt_join_form_nick").value);//姓名 var _phone=_._trim($("dt_join

代码如下:

function save(){
alert("77");
 var _nick=_._trim($("dt_join_form_nick").value);//姓名
 var _phone=_._trim($("dt_join_form_phone").value);//手机号
 var  _note=_._trim($("dt_join_form_note").value);//备注
 alert(getParam("db"));
$.post('sa1.php', { id: 34 },function (text, status) { alert(text); });
 alert("sdfds");  
}

点击按钮时向sa1.php传值,

sa1.php:

 file_put_contents("log.html",date('Y-m-d H:i:s ').$_POST["id"]."
",FILE_APPEND);    printf("4353");

?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template