1:
var BtnParts = Array();
var button_id = "_objform_objname_FontSize"
BtnParts = button_id.split("_");
objform = BtnParts[1];
objname = BtnParts[2];
FontSize = BtnParts[3];
alert(objform + "-" + objname + "-" + FontSize)2:
var re = new RegExp("_([^_]+)","g");
re.exec(button_id);
objform = RegExp.$1;
re.exec(button_id);
objname = RegExp.$1;
re.exec(button_id);
FontSize = RegExp.$1;
alert(objform + "-" + objname + "-" + FontSize)3:
var re = new RegExp("_([^_]+)","g");
var arr = button_id.match(re);
objform = arr[0].substr(1, arr[0].length-1);
objname = arr[1].substr(1, arr[1].length-1);
FontSize = arr[2].substr(1, arr[2].length-1);
alert(objform + "-" + objname + "-" + FontSize)
var BtnParts = Array();
var button_id = "_objform_objname_FontSize"
BtnParts = button_id.split("_");
objform = BtnParts[1];
objname = BtnParts[2];
FontSize = BtnParts[3];
alert(objform + "-" + objname + "-" + FontSize)2:
var re = new RegExp("_([^_]+)","g");
re.exec(button_id);
objform = RegExp.$1;
re.exec(button_id);
objname = RegExp.$1;
re.exec(button_id);
FontSize = RegExp.$1;
alert(objform + "-" + objname + "-" + FontSize)3:
var re = new RegExp("_([^_]+)","g");
var arr = button_id.match(re);
objform = arr[0].substr(1, arr[0].length-1);
objname = arr[1].substr(1, arr[1].length-1);
FontSize = arr[2].substr(1, arr[2].length-1);
alert(objform + "-" + objname + "-" + FontSize)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货