-
判断字符串中是否包含某字符串
方法一: indexOf()
// 额外段落加载
if(name.indexOf('extraP') !== -1){
extraPs[name] = value;
ExtraP.inputState($('[mpoint='+name+']'),value);
return;
}
方法二:serach() (未使用过)
var str = "123";
console.log(str.search("3") != -1 ); // true
-
jQuery动态删除html代码
$(selector).remove();
// 转载:https://www.cnblogs.com/wanghuih/p/6143577.html
-
JavaScript删除object对象某一属性
var myObject = {
"ircEvent": "PRIVMSG",
"method": "newURI",
"regex": "^http://.*"
};
delete myObject.regex;
console.log(myObject);
// 转载:https://blog.csdn.net/shenxianhui1995/article/details/86580455