html页面ajax不执行,jquery版本也没错
<!DOCTYPEhtml><html><head><title>pop.html</title><metahttp-equiv="keywords"content="k...
<!DOCTYPE html>
<html>
<head>
<title>pop.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<!--[if ie 6]>
<script src="../js/iepng.js" type="text/javascript"></script>
<![endif]-->
<script type="text/javascript">
var url=location.href;
var baseType;
function addLine(){
var arr = new Array();
arr = url.split("=");
var etype = arr[1];
alert(etype);
$.ajax({
url:"lookMore",
type:"post",
data:{type:etype},
success:function(data){
for(var i=0;i<data.length;i++){
var en=data[i];
CheckType(en.type);
if(baseType){
$("#msgTable").append("<tr><td>"+en.name+"</td><td>"+en.type+"</td><td>"+en.desc+"</td></tr>");
}else{
$("#msgTable").append("<tr><td>"+en.name+"</td><td>"+en.type+"</td><td>"+en.desc+"</td></tr>");
var ttt=en.type;
$('#msgTable tr td:nth-child(2)').click(function(ttt){
window.open ('../pages/event/pop.html?etype='+ttt, 'newwindow', 'height=150, width=400,top=200,left=500, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
});
}
}
},
cache:false,
timeout:5000,
error:function(){
alert("失败!");
}
});
}
function CheckType(type){
$.ajax({
url:"checkEtype",
type:"post",
data:{type:etype},
success:function(data){
baseType=data;
},
cache:false,
timeout:5000,
error:function(){
alert("失败!");
}
});
}
function poppage(type){
window.open ('../pages/event/pop.html?etype='+type, 'newwindow', 'height=150, width=400,top=200,left=500, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}
</script>
</head>
<body onload="addLine()">
<table class="date_table tbcol mt10" id="msgTable" align="center">
<tr><th>名称</th><th>属性</th><th>说明</th></tr>
</table>
</body>
</html> 展开
<html>
<head>
<title>pop.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<!--[if ie 6]>
<script src="../js/iepng.js" type="text/javascript"></script>
<![endif]-->
<script type="text/javascript">
var url=location.href;
var baseType;
function addLine(){
var arr = new Array();
arr = url.split("=");
var etype = arr[1];
alert(etype);
$.ajax({
url:"lookMore",
type:"post",
data:{type:etype},
success:function(data){
for(var i=0;i<data.length;i++){
var en=data[i];
CheckType(en.type);
if(baseType){
$("#msgTable").append("<tr><td>"+en.name+"</td><td>"+en.type+"</td><td>"+en.desc+"</td></tr>");
}else{
$("#msgTable").append("<tr><td>"+en.name+"</td><td>"+en.type+"</td><td>"+en.desc+"</td></tr>");
var ttt=en.type;
$('#msgTable tr td:nth-child(2)').click(function(ttt){
window.open ('../pages/event/pop.html?etype='+ttt, 'newwindow', 'height=150, width=400,top=200,left=500, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
});
}
}
},
cache:false,
timeout:5000,
error:function(){
alert("失败!");
}
});
}
function CheckType(type){
$.ajax({
url:"checkEtype",
type:"post",
data:{type:etype},
success:function(data){
baseType=data;
},
cache:false,
timeout:5000,
error:function(){
alert("失败!");
}
});
}
function poppage(type){
window.open ('../pages/event/pop.html?etype='+type, 'newwindow', 'height=150, width=400,top=200,left=500, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}
</script>
</head>
<body onload="addLine()">
<table class="date_table tbcol mt10" id="msgTable" align="center">
<tr><th>名称</th><th>属性</th><th>说明</th></tr>
</table>
</body>
</html> 展开
2个回答
2014-11-05
展开全部
你的url都是个字符串能行么
追问
被调用的方法
@RequestMapping(value = "/lookMore")
@ResponseBody
public List lookMore(String type) {
}
追答
是调用的方法,但是前面应该有服务地址呀
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询