请问如果调试页面执行情况以解决phantomjs不执行js问题?
我之前问过一个问题:请问如何解决windows环境下phantomjs不支持flash的问题?
我现在换到ubuntu环境下,phantomjs依然不执行js代码,抓不到数据。我看了页面代码,没有API,很普通,没有什么特别的。
请问:
1、如何调试,才能看到为什么不执行js代码?
2、代码如下:请帮助指导一下。
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
<title>各地动态</title>
<link href="../../images/css.css" rel="stylesheet" type="text/css">
<link href="../../images/css_992_1199.css" media="(min-width: 992px) and (max-width: 1199px)" rel="stylesheet" type="text/css">
<link href="../../images/css_992.css" media="screen and (max-width:992px)" rel="stylesheet" type="text/css">
<link href="../../images/css_1200.css" media="screen and (min-width: 1200px)" rel="stylesheet" type="text/css">
<script src="../../images/respond.src.js"></script>
<script src="../../js/flexpaper_flash.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript">
function setTab(name,num,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById(name+"_"+"con"+i);
menu.className=i==num?"now":"";
con.style.display=i==num?"block":"none";
}
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>
</head>
<body>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
<style>
.bai12 a{font-size:13px;}
</style>
<div class="fyf"><script>
var currentPage = 0;//所在页从0开始
var prevPage = currentPage-1//上一页
var nextPage = currentPage+1//下一页
var countPage = 34//共多少页
var countPage1 = countPage - 1;
var currentPage2 = currentPage + 1;//当前页
document.write("共有"+countPage+"页 ");//设置上一页代码
if(countPage>1&¤tPage!=0&¤tPage!=1)
document.write("<a href=\"index.html\">首页</a> <a href=\"index"+"_" + prevPage + "."+"html\" >上一页</a>");
else if(countPage>1&¤tPage!=0&¤tPage==1)
document.write("<a href=\"index.html\">首页</a> <a href=\"index.html\">上一页</a>");
else
document.write("<span class=\"disabled\">上一页</span>");
//循环
var num = 3;
if(countPage<=1){
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i<countPage) ; i++){
if(currentPage==i)
document.write("<span class=\"current\">"+(i+1)+"</span> ");
else if(i==0)
document.write("<a href=\"index.html\" class='fy'>"+(i+1)+"</a> ");
else
document.write("<a href=\"index"+"_" + i + "."+"html\" class='fy'>"+(i+1)+"</a> ");
}
}else{
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i<countPage-1) ; i++){
if(i>=1){document.write("<a href=\"index" + "."+"html\" class='fy'>"+1+"</a>...");}
if(i<countPage-1){
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i<countPage) ; i++){
if(currentPage==i)
document.write("<span class=\"current\">"+(i+1)+"</span> ");
else if(i==0)
document.write("<a href=\"index.html\" class='fy'>"+(i+1)+"</a> ");
else if(i==countPage){}else
document.write("<a href=\"index"+"_" + i + "."+"html\" class='fy'>"+(i+1)+"</a> ");
}
if(i<countPage){document.write("...");
document.write("<a href=\"index"+"_" + countPage1 + "."+"html\">"+(countPage)+"</a>"); }
}else{
for(var i=countPage-2+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num)-1)&&(i<countPage-1) ; i++){
if(currentPage==i)
document.write("<span style=\"color:#ff0000;font-size:12px;\" class='fy'>"+(i+1)+"</span>");
else if(i==0)
document.write("<a href=\"index.html\" class='fy'>"+(i+1)+"</a>");
else if(i==countPage){}else
document.write("<a href=\"index"+"_" + i + "."+"html\" class='fy'>"+(i+1)+"</a>");
}
}
}
}
//设置下一页代码
if(countPage>1&¤tPage!=(countPage-1))
document.write("<a href=\"index"+"_" + nextPage + "."+"html\" >下一页</a> <a href=\"index_" + (countPage-1) + ".html\">尾页</a> ");
else
document.write("<span class=\"disabled\">下一页</span>");
</script>共有34页 <span class="disabled">上一页</span><span class="current">1</span> <a href="index_1.html" class="fy">2</a> <a href="index_2.html" class="fy">3</a> <a href="index_3.html" class="fy">4</a> ...<a href="index_33.html">34</a><a href="index_1.html">下一页</a> <a href="index_33.html">尾页</a>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论