自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SalmonellaVaccine的专栏

不走弯路,也就错过了风景。无论如何,感谢经历。

  • 博客(30)
  • 收藏
  • 关注

转载 19+ JavaScript Shorthand Coding Techniques

http://www.sitepoint.com/shorthand-javascript-techniques/This really is a must read for any JavaScript based developer. I have made this post as a vital source of reference for learning shor

2015-10-23 14:33:46 519

转载 Count in String and Object

How to count string occurrence in string?var temp = "This is a string.";// the g in the regular expression says to search the whole string // rather than just find the first occurrencevar co

2015-10-23 07:25:17 433

原创 Polymer1.0中动态设置disabled

我想在下面这个button上动态绑定一个disabled,是的这个button在满足某些条件时显示,不满足时隐藏。Approve问题就在于disabled是一个boolean,不是字符串。所以当我第一开始写成disabled="{{item.disabled}}"的时候,这个button不论item.disabled是true还是false都会显示出来。后来在网

2015-10-22 14:08:47 583

转载 用node-webkit把web应用打包成桌面应用

nwjs打包app的官方文档写得很烂,下面这个博客是基本是翻译的官方文档,还有举例和配图,清楚得多。很遗憾的是,nwjs的官方文档已经烂到了不能用,按上面的步骤来得到的结果是nwjs can't extract the files from the package,浪费了我两个小时才搞清楚这一点。这也是下面转载的这篇文章从Enigma Virtual Box之后部分的价值所在。

2015-10-22 13:48:45 777

转载 什么是ShadowDom?

http://www.300168.com/yidong/show-95.html核心提示:如果我需要把每个自定义的按钮都放到iframe里,你是什么感觉,会不会疯掉?所以,我们需要一些更好的东西。事实上,大部分的浏览器已经变相地提供了一种强大技术去隐藏一些实现细节。这个技术就是所谓的“shadow DOM”。如果你做过网站,那么很可能你已经用过一些JavaScri

2015-10-21 07:24:04 552

转载 Grunt即学即用

http://www.html-js.com/article/Grunt-uses-Grunt-for-immediate-use在这篇文章中,我们将探索如何在一个项目中使用Grunt来加快并改变你开发网站的方式。我们首先将简要的说明一下Grunt究竟是用来做什么的,然后再深入说明如何设置并使用Grunt中各式各样的插件来承担项目中各种繁重的任务。其次,我们将看看如

2015-10-21 06:33:10 520

转载 给那些认为Grunt奇怪又难懂的人看的Grunt教程(二)

http://www.html-js.com/article/Grunt-use-for-those-who-believe-that-the-Grunt-strange-and-difficult-to-see-Grunt-tutorial-two使用Grunt压缩JavaScript文件在正式开始之前我们需要做很多准备工作,添加新的任务到Grunt中非常简单。我们只

2015-10-21 06:15:00 517

转载 给那些认为Grunt奇怪又难懂的人看的Grunt教程

http://www.html-js.com/article/Grunt-use-for-those-who-believe-that-the-Grunt-strange-and-difficult-to-see-the-Grunt-tutorial前端工程师经常会被要求做下面这些事:每次编写一小段CSS和JavaScript,然后在最后把它们拼接起来压缩你的CSS和Jav

2015-10-21 06:13:27 729

转载 什么是Polymer?

http://www.codesama.com/2015/07/04/polymer-learn1/Polymer是google推出的一个以Web Components为概念的WEB框架,你可以为自己创建一个HTML ELEMENT,能够像网页原生控件一样,可以应用在你网页的任何一个地方. 下面是一个简单的 Polymer 控件在网页中的写法.1234

2015-10-21 04:47:51 940

转载 How can I make a redirect page using jQuery?

http://stackoverflow.com/a/506004/2177408jQuery is not necessary, and window.location.replace(...) will best simulate an HTTP redirect.It is better than using window.location.href =,

2015-10-21 04:39:48 406

原创 .和..在路径中的区别

最近在做一个nwjs + nodejs + polymer的项目。项目快做好了,需要把代码打包成可以直接运行的文件。本来的文件结构是:app--bower_components--node_modules--src   |--client        |--index.html        |--elements.htmlindex.html

2015-10-20 11:45:00 465

转载 写了10年Javascript未必全了解的连续赋值运算

http://yanhaijing.com/javascript/2012/04/05/javascript-continuous-assignment-operator/一、引子var a = {n:1}; a.x = a = {n:2}; alert(a.x); // --> undefined 看 jQuery 源码 时发现的这种写法。 以上第二句

2015-10-19 15:59:06 430

转载 Javascript中的Bind,Call和Apply

http://www.html-js.com/article/JavaScript-functional-programming-in-Javascript-Bind-Call-and-Apply不久之前,我在一条tweet上看到了这样一段js代码: var bind = Function.prototype.call.bind(Function.prototype

2015-10-17 09:08:03 367

转载 深入浅出 妙用Javascript中apply、call、bind

https://github.com/chokcoco/apply-call-bind/tree/masterapply、call用法的简单示例function fruits() {}fruits.prototype = { color: "red", say: function() { console.log("My color is

2015-10-17 09:07:16 390

转载 Grunt Contrib Watch Example

http://www.thegeekstuff.com/2014/10/grunt-contrib-watch-automate/y LUKE P. ISSAC on OCTOBER 22, 2014As we discussed earlier, using grunt, during your development

2015-10-15 08:27:54 381

原创 Run grunt from a different directory

http://stackoverflow.com/questions/14873356/how-do-i-run-grunt-from-a-different-folder-than-my-root-project上面这个链接里面提供了一些提示,但是在windows下面有一些细微的改动,就是在盘符后面加一个冒号。假设我的GruntFile.js在 c:\Users\Source

2015-10-14 06:29:37 433

转载 js中的caller和callee属性

http://www.css88.com/archives/1706caller返回一个对函数的引用,该函数调用了当前函数。functionName.callerfunctionName 对象是所执行函数的名称。说明对于函数来说,caller 属性只有在函数执行时才有定义。 如果函数是由 Javascript 程序的顶层调用的,那么 caller 包

2015-10-13 14:58:20 422

转载 Will a recursive 'setTimeout' function call eventually kill the JS Engine?

http://stackoverflow.com/questions/6779586/will-a-recursive-settimeout-function-call-eventually-kill-the-js-engineLet's say I have some data that I need to get from the server about every 10 s

2015-10-13 14:56:18 571

转载 setTimeout()和setInterval() 何时被调用执行

http://www.cnblogs.com/dolphinx/archive/2013/04/05/2784933.html定义setTimeout()和setInterval()经常被用来处理延时和定时任务。setTimeout() 方法用于在指定的毫秒数后调用函数或计算表达式,而setInterval()则可以在每隔指定的毫秒数循环调用函数或表达式,直到clear

2015-10-13 14:52:37 336

转载 Javascript hash functions to convert string into integer hash

http://erlycoder.com/49/javascript-hash-functions-to-convert-string-into-integer-hash-In some cases it is not necesary to transfer a string to the server, as you are not going to process its c

2015-10-12 17:21:55 515

转载 Revert to a previous Git commit

http://stackoverflow.com/a/4114122/2177408This depends a lot on what you mean by "revert".Temporarily switch to a different commitIf you want to temporarily go back to it, fool aroun

2015-10-12 12:06:43 488

转载 由于detached Head而导致everything up-to-date,无法push

写代码时因为request的url错误,导致报错"undefined token o"。当时为了查找错误原因,用git checkout 回滚。找到错误之后,以为再用git checkout回滚到最新的commit就没事了。回滚到最新commit之后,有commit新代码,commit之后出现[detach HEAD]之类的信息,没当回事(后来知道这是主要原因),继续push,但是pu

2015-10-12 12:04:13 908

转载 Polymer - Pass dom-repeated item inside on-click function

http://stackoverflow.com/questions/31244400/polymer-pass-dom-repeated-item-inside-on-click-functionHow do I pass a dom-repeated item inside a function in on-click? My code doesn't work:

2015-10-09 14:13:17 642

转载 How to add custom validator to paper-input?

http://stackoverflow.com/questions/31955091/how-to-add-custom-validator-to-paper-inputQ:Need to add a custom validator which does some complex validation based on the values of other fields in

2015-10-09 14:10:46 906

转载 Polymer 1.0 - I cannot use class={{variable}}. How can I set class name dynamically?

http://stackoverflow.com/questions/30668433/polymer-1-0-i-cannot-use-class-variable-how-can-i-set-class-name-dynamicaQ:I have understood from my last question here that string concatenate

2015-10-09 14:04:50 415

转载 Make a child component call his parent API in Polymer 1.0.0

http://stackoverflow.com/questions/30583905/make-a-child-component-call-his-parent-api-in-polymer-1-0-0Question:I have two web components defined with Polymer 1.0.0 and my question is about

2015-10-09 14:03:04 818

转载 Node.js Request Module…sending json in body for api request with put

http://stackoverflow.com/questions/21359877/node-js-request-module-sending-json-in-body-for-api-request-with-put用Node.js的Request模块发送post请求,request body为JSON对象,需要设置json: truevar options = { u

2015-10-05 16:25:01 816

转载 HTML <input type='file'> File Selection Event

http://stackoverflow.com/questions/3528359/html-input-type-file-file-selection-eventListen to the change event.input.onchange = function(e) { ..};Get selected file path: document

2015-10-05 16:20:51 505

转载 How can I get file extensions with JavaScript?

http://stackoverflow.com/a/25483772/2177408If you are looking for a specific extension and know its length, you can use substr:var file1 = "50.xsl";if (file1.substr(-4) == '.xsl') {

2015-10-05 16:19:48 368

转载 Check if paper-checkbox is checked

http://stackoverflow.com/questions/28399972/control-a-paper-checkboxs-statethis.$.checkbox.checkedhttps://elements.polymer-project.org/elements/paper-checkboxChecked是paper-checkbox的prope

2015-10-05 16:18:50 452

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除