今天第一次阅读jQuery源码,因为读到用js对表单的序列化,为的是在ajax操作中将表单中各个域的值传到服务器.书上用了很长的步骤,判断每一个表单域的属性,然后拼接. 大概是这样: function serialize(form){ var parts = [], filed = null, i, len, j, ... for(i=0,len=form.elements.length;i<len;i++){ field=form.elements[i]; switch(field.type)…
//Modal function Modal(obj){ var that = this; that.ref = ""; that.obj = obj; that.init(); } Modal.prototype = { init:function(){ var that = this; jQuery('.modal-head i[role="close-modal"],[role="btncancel"],[role="btnok&…
function loadjs(url,callback){ var script=document.createElement('script'); script.type="text/javascript"; script.src=url; if(script.onreadystatechange){ script.onreadystatechange=function(){ if(script.readySta…
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others. 相信你们在学习响应式编程这个新技术的时候都会充满了好奇,特别是它的一些变体,包括Rx系列.Bacon.js.RAC和其他的一些变体. Learning it is hard, even harder by the…
/** * Created by dev013 on 9/9/14. */ var FileLoadTools = (function () { var my = {}; var htmlFile = [];// array for storing name of files loaded var jsFile = []; var cssFile = []; /** * @param {Object} file filename * @param {Object} fileArray * fun…
12306.cn买票,难死了,登录登录登录... 现在不用了... js插件+chrome浏览器: /* * 12306 Auto Query => A javascript snippet to help you book tickets online. * 12306 Booking Assistant * Copyright (C) 2011 Hidden * * 12306 Auto Query => A javascript snippet to help you book tick…