- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 javascript中的预编译
<!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <script> function fn(a){ console.log(a); var a = 123;
2018-06-23 17:24:10 137
原创 Z-index属性
<!doctype html> <html> <head> <meta charset="utf-8"> <style> .test{ width:150px; height:300px; border:1px solid #ccc; margin-top:100px; float:...
2018-06-22 16:52:52 1786
原创 初始化CSS
@charset "UTF-8"; /*css 初始化 */ html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; } fieldset, img,input,button { border:none; padding:0;m...
2018-06-19 19:59:33 167
原创 JavaScriptDOM操作表格及样式
//使用DOM创建一个表格 var table = document.createElement("table"); table.width = 300; // table.setAttribute("width", 300); table.border = 1; document.body.appendChild(table); var caption = document.cre...
2018-06-17 17:28:57 611
原创 JavaScriptDOM基础
DOM(Document object Model)文档对象模型,用来描述Javascript脚本怎样与HTML或XML文档进行交互的Web标准DOM规定:整个文档是一个文档节点,每个标签是个元素节点,元素包含的文本是文本节点,元素的属性是一个属性节点<!--本例演示如果借助节点的nodeType属性检索当前文档中包含元素的个数--> <!doctype html> <...
2018-06-16 17:20:58 264
原创 JavaScript 浏览器检测
navigator对象是window对象下的 alert(navigator.appName);//Netscape 这个属性不能精确取到浏览器名称 alert(navigator.userAgent);//用户代理字符串,表示浏览器信息的东西 alert(navigator.platform);//浏览器所在的系统 // 插件检测 for( var i =0;i<navigator...
2018-06-14 18:05:05 174
原创 Javascript BOM
BOM也叫浏览器对象模型,它提供了很多对象,用于访问浏览器的功能; window对象是最顶层的对象 window对象有六大属性(document, frames, history,location,navigator,screen),这六大属性本身也是对象 window对象下面的document属性,也是对象,并且document对象下面有五大属性(anchors, forms,images...
2018-06-14 16:15:26 193
原创 Javascript匿名函数和闭包
//普通函数 function box(){ return 'Lee'; } alert(box()); //匿名函数 function (){ //单独的匿名函数,是无法运行的 return 'Lee'; //就算能运行,也无法调用,因为没有名称 } //把匿名函数赋值给变量 var box = function(){ return 'Lee'; }; ale...
2018-06-14 10:59:28 117
原创 Javascript面向对象与原型
var box = new Object();//创建对象 box.name = 'Lee';//添加属性 box.age = 100; box.run = function(){//创建方法 return this.name + this.age +'运行中.....' } alert(box.run()); //工厂模式 function createObject(name, ag...
2018-06-13 17:45:04 118
翻译 JavaScript内置对象
Global对象的内置方法 var box = '//Lee 李'; alert(encodeURI(box)); //返回//Lee%20%E6%9D%8E 只编码了中文 var box = '//Lee 李'; alert(encodeURIComponent(box)); //返回%2F%2FLee%20%E6%9D%8E 特殊字符和中文...
2018-06-13 11:51:52 148
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人