if (IsPre) {
if (obj.previousSibling.nodeName.toLowerCase() == nodeName.toLowerCase()) {
return obj.previousSibling;
}
return GetEle(obj.previousSibling, IsPre, nodeName);
} else {
if (obj.nextSibling.nodeName.toLowerCase() == nodeName.toLowerCase()) {
return obj.nextSibling;
}
return GetEle(obj.nextSibling, IsPre, nodeName);
}
}
String.prototype.format = function() {
var reg;
var args;
if (arguments[0] && typeof (arguments[0]) == "object") {
reg = new RegExp("\\{([^\\d]\\w*)\\}", "g");
args = arguments[0];
}
else {
reg = new RegExp("\\{(\\d+)\\}","g");
args = arguments;
}
return this.replace(reg, function() {
var val = args[arguments[1]];
return val == 'undifined' ? arguments[0] : val;
});
};
//执行函数
function Exec(funcName) {
if(typeof funcName =="string")
{
//如果此函数已经被加载
if (window[funcName]) {
window[funcName]();
} //如果函数没有被加载,则每隔0.1秒检查一次,直到加载完成
else {
window.setTimeout(function() { Exec(funcName) }, 1000);
}
}else
{
funcName();
}
}
Exec(window.fun||"fun");
function fun()
{
}
//返回函数名
function Call(ff)
{
var reg=/\s+(\w+)\(\)/;
var fucnStr=ff.toString();
if(reg.test(fucnStr))
{
return fucnStr.match(reg)[1]
}
return "";
}