[問題] 找不出語法錯誤.....
抱歉小弟又來打擾了..╮(﹋﹏﹌)╭..
小弟因為想增加更多功能所以又寫了下方程式
但是DW卻在偵錯時一直告訴我下方程式碼裡有一個else出錯....(已備註)
小弟一直發現不出來錯誤來...翻書也確認過這樣寫是OK的~
而且實際跑時也被瀏覽器偵測出錯誤.........
請各位大大可以好心幫我看下嗎.....
到底是哪裡出錯了ORZ...感恩
======================================================
function warning(newestlocation)//提示玩家目前所在位置(正常情況下)
{
var s2;
if(newstlocation==0)
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==11||newstlocation==35)//採到機會格
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==1||newstlocation==25) //採到命運格
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==24)//採到監獄
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==36)//採到醫院
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==12)//採到旅館
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==23)//採到汽車
{s2=document.getElementById('location'+newestlocation)}
elseif(newstlocation==10)//採到飛機
{s2=document.getElementById('location'+newestlocation)}
else //////這行被顯示出語法錯誤.....
{s2=document.getElementById('country'+newestlocation)}
var destination=s2.innerText;
//判定傳入ID之位置並得到它代表的資訊~注意傳入值為行走格ID非地名ID且
destination為
if(((i%2)!=0)) //先判定是誰傳入值~再接著考慮2種情況 ~重疊OR不重疊
{
if(richvalue2==richvalue1)
{value2.value="目前A&B所在位置同樣都在" +destination;}
else
{value2.value="目前A所在位置為" +destination;}
}
else
{
if(richvalue1==richvalue2)
{value2.value="目前A&B所在位置同樣都在" +destination;}
else
{value2.value="目前B所在位置為"+destination;}
}
}
=========================================================
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.32.65
推
06/24 19:19, , 1F
06/24 19:19, 1F
→
06/24 19:28, , 2F
06/24 19:28, 2F
→
06/24 19:29, , 3F
06/24 19:29, 3F
→
06/24 23:59, , 4F
06/24 23:59, 4F
推
06/25 14:13, , 5F
06/25 14:13, 5F
→
06/25 14:13, , 6F
06/25 14:13, 6F