<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src="../jquery1.7.2.min.js"></script>
<script type="text/javascript">
$(function(){
/*****案例1*******/
$(".subnmit").click(function(){
var fanganid=$("#selectTitleid").val();
fananname=$("#editname").val();
$.ajax({
type:"post",
url:"/shop/sss"
dataType:"json",
data:{
"fanan":fananname,
"jsonarray":fanganid
},
success:function(data){
if(data.status==success){
window.location.href="chen.com";
}
}
})
})
/*******案例2*******/
$(".send").click(function(){
var fanganid=$("#selectTitleid").val();
fananname=$("#editname").val();
$.ajax({
type:"post",
url:"baidu.com",
dataType:"json",
data:{
"fanan":fananname,
"jsonarray":fanganid
},
success:function(data){
$(".txt").empty();
var html="";
$.each(data,function(index,comment){
html+='<div class="comment"><h6>' + comment['username']
+ ':</h6><p class="para"' + comment['content']
+ '</p></div>';
})
$(".txt").html(html);
}
})
})
})
</script>
</body>
</html>