【发布时间】:2013-04-15 09:28:38
【问题描述】:
我有一个简单的链接列表,所以当点击每个链接时,我应该会弹出一个对话框,其中包含更多信息,这些信息是从 DB 获取的,并作为 json 对象发布回该对话框。
现在的问题,这个设置可以在我的一台服务器上运行,而不能在另一台服务器上运行。两台服务器都运行 Apache 并且两台服务器总体上非常相似,除了一件事,第一个(工作的)是 VPS,第二个是共享主机,我真的不确定这是否与它有关,但这是唯一让我想到的事情。
<head>
<link rel=stylesheet href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/start/jquery-ui.css" type="text/css">
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script>
function user_dialog(a,b){
"undefined"!=typeof jQuery.ui?($("#dialog").attr("title","Detailed Information").html(a),
$("#dialog").dialog({
modal:true,
width:400,
buttons: {
Cancel: function() {
$(this).dialog("close");
},
Download: function(){
$(this).dialog("close");
window.location=b
}
}
}
))
:window.location=b}
function user_notice(a){
download_link=$(a).attr("href");
$.ajax({
type:"POST",
url:"/includes/json.php",
data:"action=reminder&thepath="+download_link,
dataType:"json",
error:function(){
window.location=download_link
},
success:function(a){
1==a.status&&user_dialog(a.html,download_link);
}
})
};
</script>
</head>
<body>
<div class="bb_button"><a class="bb_xls" href=" " rel="nofollow" onClick=" user_notice(this,''); return false;">Download Now</a></div>
<div id="dialog" style="display:none;"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<div id="g_plus_message"></div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js?ver=1.10.1"></script>
</body>
非常感谢任何帮助
【问题讨论】:
-
“不工作”是什么意思?您有任何警报、错误、调试信息吗?
-
什么都没有,没有任何警报,我不知道如何调试它
-
在 Chrome 中按 F12 或在 Firefox 中运行 Firebug,打开控制台和网络连接,看看那里发生了什么。
-
感谢安德烈,发现错误标头('Status: 403 Forbidden');坐在json.php中。 (Bolshoe sposibo za pomosh)