摘要: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script> window.onload = function () { var txt = document.getElementByI 阅读全文
posted @ 2019-12-17 18:17 杨小越 阅读(656) 评论(0) 推荐(0)
摘要: 1. 函数的 arguments 对象并不是一个数组,但访问单个参数的方式与访问数组元素的方式相同; 2. arguments对象的长度是由实参个数而不是形参个数决定的。 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> < 阅读全文
posted @ 2019-12-17 16:33 杨小越 阅读(401) 评论(0) 推荐(0)
摘要: var fun = new Function("var a = 10; var b = 20; alert(a+b)"); fun(); 阅读全文
posted @ 2019-12-17 16:26 杨小越 阅读(87) 评论(0) 推荐(0)
摘要: 1. 利用 -0 ,*1 , /1 ,都可以转换 2 利用Number( ) ,parseInt(), parseFloat() 阅读全文
posted @ 2019-12-17 16:09 杨小越 阅读(557) 评论(0) 推荐(0)
摘要: 1. 利用 !! 2.利用 Boolean() 阅读全文
posted @ 2019-12-17 16:07 杨小越 阅读(822) 评论(0) 推荐(0)
摘要: 1. + "" 加了引号的都是字符型 console.log(typeof (false+'')); console.log(typeof (new Date()+'')); 2.利用String(); 转换为字符型 console.log(typeof String(false));console 阅读全文
posted @ 2019-12-17 16:05 杨小越 阅读(825) 评论(0) 推荐(0)
摘要: 隐式的全局变量:没有声明var的变量也是全局变量。 注意:严格模式下报错! var a = 1 function func() { a = b = 2 } func() alert(a) alert(b) 阅读全文
posted @ 2019-12-17 15:34 杨小越 阅读(282) 评论(0) 推荐(0)
摘要: 变量的命名规则: 1.变量命名必须以字母或是下标符号”_”或者”$”为开头。 2.变量名长度不能超过255个字符。 3.变量名中不允许使用空格。 4.不用使用脚本语言中保留的关键字及保留符号作为变量名。 5.变量名区分大小写。(javascript是区分大小写的语言) 阅读全文
posted @ 2019-12-17 15:29 杨小越 阅读(3618) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>Title</title> <style> img{ width: 320px; //高度按比例自适应 } </style> </head> <body> 阅读全文
posted @ 2019-12-17 15:20 杨小越 阅读(906) 评论(0) 推荐(0)
摘要: console.log(null==undefined); // true console.log(null undefined); // false console.log(null+10); // 10 console.log(undefined+10); // NaN 阅读全文
posted @ 2019-12-17 14:35 杨小越 阅读(137) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script> console.log(parseInt(19.11)); console.log(parse 阅读全文
posted @ 2019-12-17 14:29 杨小越 阅读(479) 评论(0) 推荐(0)
摘要: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{ margin: 0; padding: 0; } section{ width: 100px; heig 阅读全文
posted @ 2019-12-17 14:06 杨小越 阅读(259) 评论(0) 推荐(0)
摘要: display:none; /*不占空间*/ visibility: hidden; /*占空间*/ visibility: visible; /*显示的意思*/ 阅读全文
posted @ 2019-12-17 13:58 杨小越 阅读(121) 评论(0) 推荐(0)
摘要: document.write("<h1>今天下雪了</h1>"); //字符串中可以加html的标签 阅读全文
posted @ 2019-12-17 13:40 杨小越 阅读(179) 评论(0) 推荐(0)
摘要: console.log("今天是");console.warn("星期五");console.error("天气很好"); console 使用代码 作用 console.log() 控制台输出 普通输出语句 console.warn() 控制台警示 console.error(); 错误提示 阅读全文
posted @ 2019-12-17 13:36 杨小越 阅读(2074) 评论(0) 推荐(0)