我使用搜索功能在字符串中搜索匹配,比如下面說的JS ......說,第一個結果被發現,以及.......第二個被發現,以及....第3個編號沒有找到,那麼控制/光標出來的循環,我的意思是,馬上就要終止,我認爲ELSE條件是gonnna觸發,並繼續迭代,直到長度結束......但在中間它的終止! PLS。建議我修復或提供新的JS,謝謝爲什麼LOOP馬上就要結束了?
// OriginalFields is a string, its fillled with fields list with space seperator
myArrayGrey = greyFields.split(" ");
for (var i = 0; i < myArrayGrey.length; i++) {
var returnValue = OriginalFields.search(myArrayGrey[i]);
if (returnValue != -1) {
//grey the field
// and
// make access = "readOnly";
};
else {;
// do nothing
// just for my testing am doing app.alert (not found)
};
};
格式的代碼! –
嘿@JuanMendes,看到[編輯](http://stackoverflow.com/posts/13038343/edit)鏈接... – j08691