我正在寻找将ajax中的cityField的值传递给$ _POST ['cityField']。一切看起来都在秩序,但该变量不传递到PHP上nextpage.phpAjax变量不传递给php
<script type="text/javascript">
$('#city').blur(function() {
var cityField=$('#city').val();
$.ajax({
type:"post",
url:"nextpage.php",
data:{'cityField':cityField },
dataType:"html",
success:function(data) {
alert("You typed:"+cityField);
}
});
});
</script>
什么事?你可以发布你的PHP网站的方法? – 2014-10-03 11:56:44
在nextpage.php中显示whats还有如何验证该值没有通过? – mithunsatheesh 2014-10-03 11:57:07
您正在提醒成功事件中的“cityField”。警报“数据”以查看服务器响应。 – nocarrier 2014-10-03 11:58:37