随笔分类 - JavaScript
摘要:query中各个事件执行顺序如下: 1.ajaxStart(全局事件) 2.beforeSend(局部事件) 3.ajaxSend(全局事件) 4.success(局部事件) 5.ajaxSuccess(全局事件) 6.error(局部事件) 7.ajaxError (全局事件) 8.complet
阅读全文
摘要:1 pushHistory(); 2 3 function pushHistory() { 4 var state = { 5 title: "title", 6 url: "#" 7 }; 8 window.history.pushState(state, "title", "#"); 9 } ...
阅读全文
摘要://获取URL的参数 var $_GET = (function () { var url = window.document.location.href.toString(); var u = url.split("?"); if (typeof (u[1]) == "string") { ...
阅读全文
摘要:// 字符串对象扩展replaceAll方法 String.prototype.replaceAll = function(s1, s2) { return this.replace(new RegExp(s1, "gm"), s2); }
阅读全文
摘要:1 // 对Date的扩展,将 Date 转化为指定格式的String 2 // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, 3 // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) 4 // 例子: 5 //
阅读全文
摘要:1 loadXML = function (xmlString) { 2 var xmlDoc = null; 3 //判断浏览器的类型 4 //支持IE浏览器 5 if (!window.DOMParser && window.ActiveXObject) { //window.DOMParser
阅读全文

浙公网安备 33010602011771号