[問題] javascript和伺服器的問題
我使用php+js來寫網頁,環境是appserv-win32-2.5.10,IIS有關閉。
測試時在自己電腦的本機端執行OK,但是將程式放到伺服器上從用戶端執行時,有js的部
份都無法執行,也沒有出現任何錯誤訊息,後來直接從伺服器的本機端測試卻能正常執行
,所以應該不是程式碼的問題,我有想過會不會是伺服器權限設定的問題,如果是我應該
怎麼設定?如果不是那會是什麼原因呢?
程式碼範例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles.css" /> <!--加入CSS樣式-->
<script language="JavaScript" src="pupdate.js">
</script>
<title>指派作業</title>
<script language="javascript">
<!--刪除作業-->
function del(j_num,n_appendix,account,Class)
{
if(confirm("您確定要刪除嗎?")==true)
{
location.href="as01.php?action=del&j_num="+j_num+"&n_appendix
="+n_appendix+"&account="+account+"&class="+Class;
return true;
}
else
{
return false;
}
}
</script>
</head>
<body>
<form>
<p class="path">
<a href="as.php">指派作業</a>
</p>
</form>
<form name="as" method="get" action="as.php">
<input type="button" onClick="return del('01','name.rar','user','homework');"
value="刪除作業"/>
</form>
</body>
</html>
------以上為as.php程式碼,程式已放在伺服器的www資料夾下------
正常情況下我點了刪除作業的按鈕頁面會顯示"您確定要刪除嗎?"的訊息視窗,但是從用戶
端點按鈕卻沒有顯示此視窗,在伺服器執行localhost/as.php是正常的,有大大知道這是
什麼問題嗎><?
這困擾我好久,但因專題需求必須解決它,爬了文也google過但沒有人發問這類的問題,
小妹對伺服器比較生疏,如果有哪邊說明不清楚的我再補充,麻煩各位了 m( >_< )m
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.254.156.25
→
10/06 09:06, , 1F
10/06 09:06, 1F
→
10/06 09:23, , 2F
10/06 09:23, 2F
※ 編輯: Snow2112 來自: 111.254.211.169 (10/06 09:24)
推
10/06 10:20, , 3F
10/06 10:20, 3F
→
10/06 10:20, , 4F
10/06 10:20, 4F
→
10/06 10:21, , 5F
10/06 10:21, 5F
→
10/06 10:23, , 6F
10/06 10:23, 6F
→
10/06 10:24, , 7F
10/06 10:24, 7F
→
10/06 10:24, , 8F
10/06 10:24, 8F
→
10/06 12:20, , 9F
10/06 12:20, 9F
→
10/06 12:21, , 10F
10/06 12:21, 10F
→
10/06 12:23, , 11F
10/06 12:23, 11F
推
10/06 19:38, , 12F
10/06 19:38, 12F
→
10/06 19:38, , 13F
10/06 19:38, 13F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):