2017年2月17日
摘要: 跳转过程前手动存取当前页面信息 $(function(){ var aList = document.querySelectorAll("a"); for (var i=0;i<aList.length;i++) { aEvent(i) } function aEvent(i){ $(aList[i 阅读全文
posted @ 2017-02-17 14:01 田潇 阅读(1419) 评论(0) 推荐(0) 编辑
  2016年5月5日
摘要: $.ajax({ type: "get", //(默认: "GET") 请求方式 ("POST" 或 "GET"), 默认为 "GET"。注意:其它 HTTP 请求方法,如 PUT 和 DELETE 也可以使用,但仅部分浏览器支持。 url: "你的网址", timeout : 3000 ,//设置 阅读全文
posted @ 2016-05-05 14:02 田潇 阅读(190) 评论(0) 推荐(0) 编辑
  2016年4月27日
摘要: function fn(){ alert(a); }; fn(); (function fn(){ alert(a); })(); 6666 (function(){ 闭包的写法也是 var。。 定义的变量可以有效的防止全局污染 })() 阅读全文
posted @ 2016-04-27 10:03 田潇 阅读(114) 评论(0) 推荐(0) 编辑
摘要: function fn1(){ var a=1; fuction fn2(){ alert(a++); } return fn2; } fn1();//1 fn1();//2 引用fn2的存在导致内存不会销毁a; 保护了内部的私有变量不被改变; 可调用上下文的变量; 典型应用jquery 但是不被销 阅读全文
posted @ 2016-04-27 09:53 田潇 阅读(114) 评论(0) 推荐(0) 编辑
  2016年4月25日
摘要: var winWidth = window.innerWidth;var remVal = winWidth / 10; <div id="main"> <div class="demo"> <canvas width="10.0rem" height="3.125rem" > </canvas> 阅读全文
posted @ 2016-04-25 15:02 田潇 阅读(2696) 评论(0) 推荐(0) 编辑
  2016年4月19日
摘要: 移动端不支持a标签 了好坑 $(".pingjia").tap(function () {// body...alert(1);window.location.href="./evaluate.html"// window.location.href="http://www.baidu.com"}) 阅读全文
posted @ 2016-04-19 17:41 田潇 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 设置webview的属性如下 WebSettings settings = mWebView.getSettings(); settings.setDomStorageEnabled(true); 阅读全文
posted @ 2016-04-19 17:40 田潇 阅读(437) 评论(0) 推荐(0) 编辑
  2016年4月6日
摘要: 5种原始类型: undefined、null、bool、number、string 引用类型(new出来的) typeof undefined、object、boolean、number、string 、Object constructor undefined、null、bool、number、st 阅读全文
posted @ 2016-04-06 15:27 田潇 阅读(541) 评论(0) 推荐(0) 编辑
  2016年3月23日
摘要: 还没看懂 阅读全文
posted @ 2016-03-23 16:16 田潇 阅读(154) 评论(0) 推荐(0) 编辑
  2016年3月15日
摘要: 1通过npm安装react-tools  用命令jsx --watch src/ build/手动编译 2通过webpack 利用loader加载编译 未配置package下可通过命令 webpack --config webpack.config.js 手动编译 配置webpack下 直接执行打包 阅读全文
posted @ 2016-03-15 10:15 田潇 阅读(350) 评论(0) 推荐(0) 编辑