ajax使用post方法

<script language=javascript src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "POST",
url:"hello.php",
dataType:'json',
data:{"sitename":"phpjx","url":"http://www.phpjx.com"},
success:function(data){
alert(data.sitename);
alert(data.url);
}
});
})
</script>
apache232:8088 
 
hello.php
<?php
$post=$_POST;
print_R(json_encode($post)); 
    A+
发布日期:2014年01月08日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: