ニコニコのJSを眺めていたら、おもしろいコードがあったのでメモする。 マイページで読み込まれるmy3.jsの236行目*1 var ts = new Date/1000|0; まず、new Date/1000 。 getTime() を書かなくても、勝手にミリ秒にしてくれるとは知りませんでした。 >>> new Date/1000 1234567890.123 // 上と同じ >>> (new Date).getTime()/1000 1234567890.123 掛け/割り/引き算は数値として扱われるけど、 足し算だと文字列(Date.toString()した値)として扱われるっぽい。 >>> new Date*1 1234567890123 >>> new Date/1 1234567890123 >>> new Date-0 1234567890123 >>> new Date+0
One of the most interesting new parts of ECMAScript 6 are arrow functions. Arrow functions are, as the name suggests, functions defined with a new syntax that uses an “arrow” (=>) as part of the syntax. However, arrow functions behave differently than traditional JavaScript functions in a number of important ways: Lexical this binding – The value of this inside of the function is determined by whe
Events can be triggered on any part of a document. They don’t just start and end in one place; they flow though the document. This life cycle is what makes DOM events so extensible and useful. As developers, we should understand how DOM events work, so that we can harness their potential and build engaging experiences. In this article, Wilson Page will introduce the basics of working with DOM even
## Javascript A global `slidr` object is available for calling. The most minimal way of creating a slidr is this: ```javascript slidr.create('slidr-id').start(); ``` `create()` accepts an optional settings parameter as its second argument. A call with all the settings toggled looks like so: ```javascript slidr.create('slidr-id', { after: function(e) { console.log('in: ' + e.in.slidr); }, before: f
What is Offline.js? Offline.js is a library to automatically alert your users when they've lost internet connectivity, like Gmail. It captures AJAX requests which were made while the connection was down, and remakes them when it's back up, so your app reacts perfectly. It has a number of beautiful themes and requires no configuration. Install The easiest way to add Offline to your site is with Eag
<h1>WYSIHTML5 - A better approach to rich text editing</h1> <p>wysihtml5 is an <span class="wysiwyg-color-green"><a href="https://github.com/xing/wysihtml5">open source</a></span> rich text editor based on HTML5 technology and the progressive-enhancement approach. It uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inlin
In most JavaScript engines, there is a global object console with methods for logging and debugging. That object is not part of the language proper, but has become a de facto standard, since being pioneered by the Firebug debugger. Since their main purpose is debugging, the console methods will most frequently be used during development and rarely in deployed code. This blog post gives an overview
This article helps procedural or object oriented programmers refactor the way they think to a more functional approach using practical examples in JavaScript. We will cover the cornerstones of functional programming such as function purity, recursion, map, reduce, curry and compose. Why Functional? Functional programming can be hard to wrap your head around. Yes, that’s right you’re not the only o
While there are some legitimate bugs and differences in state handling even in modern browsers, they are relatively small enough now that you can just use the native HTML5 History API. If you intend to support legacy browsers, then History.js is your bet. This notice is here as History.js does not receive enough funding to be maintained, so it exists only in legacy condition for legacy browsers. P
“オフラインファースト”を実現する、ストレージ系APIライブラリ10選:UXClip(36)(1/3 ページ) 2012年末に“オフラインファースト”という言葉がジョー・ランバート氏のブログで取り上げられました。オフラインファーストを実現するための技術であるストレージ系APIを取り扱うライブラリについて、筆者が選んだ10個を紹介します。 はじめに 2012年末に“オフラインファースト”という言葉がジョー・ランバート氏のブログで取り上げられました。日本では「html5とか勉強会」において、白石俊平氏が取り上げたことはまだ記憶に新しいと思います(参考記事:オフラインWebの活路はモバイルアプリにある)。 オフラインファーストは、オフライン対応を仕様に組み込んだ上で、WebサイトやWebアプリケーションを作ろうという設計思想の1つです。代表的なところでは、グーグルが提供するGmailやGoogl
Each example has its own HTML page. Check the source code to see how it works. a different travel booking web browser console clauses crayola colors draw a robot Use the code playground to try it out complete.ly is an open source javascript library (MIT License). It has no dependencies, no CSS, no built-in ajax and an Occam's Razor API. It pollutes your global scope with the variable 'completely'
The blog tapquo.com has been acquired by FindMyHosting.com. Its best and archived contents are kept alive as sub-pages of FindMyHosting.com/tapquo/ FindMyHosting.com takes no responsibility for the factual accuracy or anything else regarding the archived Tapquo contents posted under FindMyHosting.com/tapquo/ About Tapquo.com: Tapquo, founded in 2011, was built to develop meaningful projects design
WOW, that's deep man! parallax.js reacts to the orientation of your smart device, offsetting layers depending on their depth within a scene... Oh, you don't have a smart device? No worries, if no gyroscope or motion detection hardware is available, parallax.js uses the position of your cursor instead. Radical. This project is a collaboration between Matthew Wagerfield & Claudio Guglieri.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く