随笔分类 -  Javascript & Jquery

摘要:Some code samples for this pupose: import React from "react"; import MyDemo from "./mydemo.jsx"; export default class Square extends React.Component { 阅读全文
posted @ 2018-05-11 23:30 calochCN 阅读(107) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-05-10 09:20 calochCN 阅读(9) 评论(0) 推荐(0)
摘要:as the subject. It is only supported in Chrome version 60+, so, first check the version, or just use Object.assign maybe. 阅读全文
posted @ 2018-04-09 19:54 calochCN 阅读(126) 评论(0) 推荐(0)
摘要:发布于 5 年前 作者 wppept 275957 次浏览 最后一次编辑是 1 年前 发布于 5 年前 作者 wppept 275957 次浏览 最后一次编辑是 1 年前 这个也是网上搜的,亲自试过,非常好用! 镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置 阅读全文
posted @ 2017-08-11 12:52 calochCN 阅读(170) 评论(0) 推荐(0)
摘要:近来用vuejs, vuejs和angular的不同在于它直接暴露了一个构造函数,而后在里面写各种config, 和模板再相对,而且vuejs也有对应的模板双向绑定机制,这样就使开发非常简单容易,虽然vuejs在概念上后来跟进了angular这样的框架,引入了各种分层理念,但在核心用法上却是非常简省 阅读全文
posted @ 2017-05-17 11:26 calochCN 阅读(685) 评论(0) 推荐(0)
摘要:http://www.jqcool.net/jquery-jspdf.html[from this site] 阅读全文
posted @ 2016-11-19 10:49 calochCN 阅读(158) 评论(0) 推荐(0)
摘要:function alertFunc(str1,str2,str3){ alert(str1); alert(str2); alert(str3); } function callAlert(functionName){ var func=eval(functionName); new func(argumen... 阅读全文
posted @ 2016-08-07 07:44 calochCN 阅读(508) 评论(0) 推荐(0)
摘要:1.获取所有eventhandler 使用 getEventHandler(target) 2.target.addEventHandler(type,handler,userCapture?) 3.target.removeEventHandler(type,handler,userCapture 阅读全文
posted @ 2016-08-06 14:49 calochCN 阅读(1455) 评论(0) 推荐(0)
摘要:my error handling clause:window.onerror = function (errorMessage, scriptURI, lineNumber, columnNumber, errorObj) { console.log("error message:", errorMessage); console.log("error file:", scr... 阅读全文
posted @ 2016-06-20 14:00 calochCN 阅读(179) 评论(0) 推荐(0)
摘要:escape() 方法: 采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进制数字)。比如,空格符对应的编码是%20。 不会被此方法编码的字符: @ * / + encodeURI() 方法: 把URI字符串采用UTF-8编码格式转化成escape格式的字... 阅读全文
posted @ 2016-05-24 09:36 calochCN 阅读(161) 评论(0) 推荐(0)
摘要:之前一直需要一个拖拽效果,网上找了些感觉不是不好用,就是写的有些地方让人不太满意,下面贡献一个自己写的。亲测可用,拖动后可互换位置!(带有注释) 方法/步骤 CSS代码部分 JS代码部分 上面的是网页 head区域, 下面的是 body区域 阅读全文
posted @ 2016-05-12 12:57 calochCN 阅读(2367) 评论(1) 推荐(1)
摘要:[‎5/‎3/‎2016 4:18 PM] Calos Chen: function a(b,e){var a=0;a+=b;if(e){console.log(b+e);return;} return function(c){a+=c;console.log(a)}} output: a(2,3) 5 a(2,3) 5两种写法结果一样 a(2,3)和a(2)(3) 阅读全文
posted @ 2016-05-03 16:32 calochCN 阅读(176) 评论(0) 推荐(0)
摘要:/* Author: Calos Description: patv2 pager !import: this pager goes with the time, we just temporarily stay, what a sad fact! */ (function ($) { $.fn.patpager = function (options) { opti... 阅读全文
posted @ 2016-04-06 15:32 calochCN 阅读(500) 评论(0) 推荐(0)
摘要:接口是基于实例方法的,如果未实现,静态方法就会抛出错误。 阅读全文
posted @ 2016-03-31 13:10 calochCN 阅读(404) 评论(1) 推荐(0)
摘要:jQuery插件开发入门 发表于 2014年05月23日 by 天涯孤雁 被浏览 20,897 次 2014-5-27 更新 Require.js中使用jQuery 插件请查看http://www.css88.com/archives/4826 感谢,huugle的留言; 扩展jQuery插件和方法 阅读全文
posted @ 2016-03-29 10:44 calochCN 阅读(307) 评论(0) 推荐(0)
摘要:$(document).on("click","#a",function(){alert(1)}) [#document] as a replacement of previous delegate etc.. event capture netscape 和 微软 曾经的战争还是比较火热的,当时, 阅读全文
posted @ 2016-03-28 13:48 calochCN 阅读(6884) 评论(0) 推荐(0)
摘要:<button onclick="text1.scrollTop=text1.scrollHeight">滚动</button><br> cache the xmlhttprequest instance, if you want to use setinterval or settimeout. 阅读全文
posted @ 2016-03-13 22:42 calochCN 阅读(1817) 评论(0) 推荐(0)
摘要:var a=function(a,c){if(a)c(a)} undefined a(true,(console.log)) VM177:2 Uncaught TypeError: Illegal invocation(…)a @ VM177:2(anonymous function) @ VM18 阅读全文
posted @ 2016-03-11 08:58 calochCN 阅读(295) 评论(0) 推荐(0)
摘要:scenario: need to display raw xml, what does text() method do: <> converted to <> i.e. 把操作符号编码为html编码 显示原始html的方法, function htmlEncode(xml){ //1.to ht 阅读全文
posted @ 2016-03-10 10:34 calochCN 阅读(141) 评论(0) 推荐(0)
摘要:http://plugins.jquery.com/?s=bootstrap 1. /reg/.test(strval) 2."strval".match(/reg/g), a reverse style of reg.exec, but when whether with g, exec resu 阅读全文
posted @ 2016-03-03 10:27 calochCN 阅读(395) 评论(0) 推荐(0)