摘要:
Object.prototype.toString.call([]); Object.prototype.toString.call({}); // toLowerCase() 转化成小写 与 typeof 返回值同步 阅读全文
posted @ 2016-01-29 15:50
JS小灰童鞋
阅读(120)
评论(0)
推荐(0)
摘要:
【 基本数据类型 】-->5种 Undefined Null Boolean Number String 【 复杂数据类型 】-->1种 Object 【 typeof 返回值】 -->6种 "undefined" "boolean" "string" "number" "object" "func 阅读全文
posted @ 2016-01-29 15:34
JS小灰童鞋
阅读(168)
评论(0)
推荐(0)
摘要:
<script> var name = "jack"; age = "18"; //console.log(name,age); //不报错 但不推荐 function test(){ gender = "man"; //全局变量 但必须调用一次该函数 } test(); console.log(g 阅读全文
posted @ 2016-01-29 15:25
JS小灰童鞋
阅读(105)
评论(0)
推荐(0)
摘要:
<script> function randomNumber(n, start, end) { var i = 0, arr = []; for (; arr.length < n; i++) { var num = Math.floor(Math.random() * (end - start)) 阅读全文
posted @ 2016-01-29 13:10
JS小灰童鞋
阅读(567)
评论(0)
推荐(0)
摘要:
<script> // jQuery $('.el').on('event', function() { }); // 原生方法 [].forEach.call(document.querySelectorAll('.el'), function(el) { el.addEventListener( 阅读全文
posted @ 2016-01-29 11:28
JS小灰童鞋
阅读(320)
评论(0)
推荐(0)
摘要:
<script> $('.el').addClass('class'); $('.el').removeClass('class'); $('.el').toggleClass('class'); // 原生方法 document.querySelector('.el').classList.add 阅读全文
posted @ 2016-01-29 11:25
JS小灰童鞋
阅读(200)
评论(0)
推荐(0)
摘要:
<script> function imgCode() { $("#imgCode").on("click", function() { $(this).attr("src", '/user/verify?t=' + Math.random()); }); }; /* 当后台返回验证码错误时,绑定t 阅读全文
posted @ 2016-01-29 11:11
JS小灰童鞋
阅读(1197)
评论(0)
推荐(0)
摘要:
var _HOSTNAME_ = [window.location.protocol, '//', window.location.hostname, '/'].join(''); if (/^http/.test(data.data.url)) { window.location.href = d 阅读全文
posted @ 2016-01-29 11:04
JS小灰童鞋
阅读(127)
评论(0)
推荐(0)
摘要:
<body> <span id="sendCode" style="background: #ccc;padding: 5px;">发送验证码</span> <script src="http://code.jquery.com/jquery-1.12.0.min.js"></script> <sc 阅读全文
posted @ 2016-01-29 10:58
JS小灰童鞋
阅读(162)
评论(0)
推荐(0)
摘要:
<script> function timerOver(year, month, day) { window.setInterval(function() { var now = new Date(), endDate = new Date(year, month - 1, day), leftTi 阅读全文
posted @ 2016-01-29 10:35
JS小灰童鞋
阅读(146)
评论(0)
推荐(0)
摘要:
<script> var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return { //移动终端浏览器版本信息 trident: u.indexOf('Tr 阅读全文
posted @ 2016-01-29 10:27
JS小灰童鞋
阅读(169)
评论(0)
推荐(0)
浙公网安备 33010602011771号