我有以下代码:
var windowNow = window.localStorage.getItem("windowNow");
switch(windowNow)
{
case 1:
var link = "http://www.zive.sk/rss/sc-47/default.aspx";
var listviewID = "feedZive";
break;
case 2:
var link = "http://mobilmania.azet.sk/rss/sc-47/default.aspx";
var listviewID = "feedMobil";
break;
case 3:
var link = "http://www.automoto.sk/rss";
var listviewID = "feedAuto";
break;
}
我知道,windowNow === 1
因为我已经用 alert 进行了检查,并且为了确保它真的是 1 我检查了它if(windowNow == 1) { alert ("Window now is 1");}
并且它有效。但它在我的开关内不起作用(通过警报检查)。