js截取前两位字符该怎么写setTimeout(function() {}, 1000);var a = name.substring(0,2);if (a == '11' ) { _g().getWidgetByName("tabpane0").showCardByIndex(4);}else if (a == '22' ) { _g().getWidgetByName("tabpane0").showCardByIndex(0);}else if (a == '33' ) { _g().getWidgetByName("tabpane0").showCardByIndex(1);}else if (a =='44' ) { _g().getWidgetByName("tabpane0").showCardByIndex(2);}else { _g().getWidgetByName("tabpane0").showCardByIndex(3);}