<script type="text/javascript">
var object = {};
var b = true;
alert(typeof object + " " + typeof b);
</script>
/*var object = {};
var b = true;
alert(typeof object + " " + typeof b);*/
alert(typeof null + " " + typeof undefined)
var now = new Date(); var pattern = /^[\s\S]*$/; var names = ['zq', 'john']; alert((now instanceof Date) + " " + (pattern instanceof RegExp) + " " + (names instanceof Array));
<!doctype html> <html lang="en"> <head> <title>Main</title> </head> <frameset cols="45%,*"> <frame name="frame1" src="frame1.html"/> <frame name="frame2" src="frame2.html"/> </frameset> </html>
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>frame1</title> </head> <script type="text/javascript"> var names = ['riccio zhang', 'zq', 'john']; </script> <body style="background: #ccc"> </body> </html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>frame2</title>
<script type="text/javascript">
document.write("top.frame1.names instanceof Array:"
+ (top.frame1.names instanceof Array));
document.write("<br/>");
document.write("top.frame1.names instanceof top.frame1.Array:"
+ (top.frame1.names instanceof top.frame1.Array));
document.write("<br/>");
document.write("top.frame1.Array === top.frame2.Array?" + (top.frame1.Array === top.frame2.Array));
</script>
</head>
<body style="background: #747474">
</body>
</html>
var toString = {}.toString;
var now = new Date();
alert(toString.call(now))
var tools = (function(undefined){
var class2type = {},
toString = {}.toString;
var fun = {
type: function (obj){
return obj === null || obj === undefined ?
String(obj) : class2type[toString.call(obj)]
},
isArray: function (obj){
return fun.type(obj) === "array";
},
isFunction: function (obj){
return fun.type(obj) === "function";
},
each: function (arr, callback){
var i = 0,
hasLength = arr.length ? true : false;
if(!callback || (typeof callback !== 'function') || !hasLength){
return;
}
for(i = 0; i< arr.length; i++){
if(callback.call(arr[i], i, arr[i]) === false){
break;
}
}
}
};
fun.each("Boolean Number String Array Date RegExp Object Function".split(" "), function(i, name){
class2type["[object "+ name +"]"] = name.toLowerCase();
});
return fun;
})();
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>frame2</title>
<script type="text/javascript" src="tools.js"></script>
<script type="text/javascript">
document.write("top.frame1.names instanceof Array:"
+ (top.frame1.names instanceof Array));
document.write("<br/>");
document.write("top.frame1.names instanceof top.frame1.Array:"
+ (top.frame1.names instanceof top.frame1.Array));
document.write("<br/>");
document.write("top.frame1.Array === top.frame2.Array?" + (top.frame1.Array === top.frame2.Array));
document.write("<br/>");
document.write("tools.isArray(top.frame1.names)?" + tools.isArray(top.frame1.names));
</script>
</head>
<body style="background: #747474">
</body>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有