JavaScript的for in语句
用于枚举对象的属性
例:
for(sProp in window)
{
alert(sProp); //显示BOM window对象的所有属性。
}
propertyIsEnumerable()是ECMAScript中专门用于说明属性是否可以用for-in语句访问的方法。
相关文档:
with(document)
{
write ("test");
write
("dsasfda");
}
上面是用了with
如果不用的话就要这样写了
document.write (" ......
在javascript控制div之间的外边距时,代码写到
document.getElementById("").style.marginTop=20;
这个在IE浏览器中可以,但是在chrome中就不行,这个问题是应该
document.getElementById("").style.marginTop="20px";
各个浏览器中不同的问题要求不等对待,这些天学了div+css在设置各个浏览器是不同的配置,要针对每个 ......
//String.prototype使用
//批量替换,比如:str.ReplaceAll([/a/g,/b/g,/c/g],["aaa","bbb","ccc"])
String.prototype.ReplaceAll=function (A,B) {
var C=this;
for(var i ......
JavaScript以ECMAScript标准作为功能基准,ECMAScript有5种原型类型:Undefined,Null,Boolean,Number和String。
可以用typeof来判断类型,例:
var sTemp = "test string";
alert(typeof sTem ......