こんにちは、中川です。 今回はJavaScriptで開発していると、うっかりハマってしまうちょっとした罠たちを紹介したいと思います。 JavaScriptでの開発経験者であれば、どれか一度はひっかかったことがあるのではないでしょうか? String ●String#replace()は文字列指定では全部置き換えない 対象文字列を一括して置き換えたいなどでString#replace()を使いますが、 検索対象を文字列で指定してしまうと最初に一致した部分しか置換しません。
こんにちは、こんばんわ NHN Japan ウェブサービス本部開発1室UITチーム 吉田徹生(@teyosh)と申します。 最近ではJavaScriptのMVCフレームワークが雨後のタケノコのようにたくさん出てきています。 先日Quirks ModeがJavaScript Libraryの利用状況をアンケートが公開していました。 backbone.jsやknockout.jsなど、MVCライブラリもランクインしてきました。 その中で今回はAngularJSを紹介しようと思います。 まずは、Angular JSについて AngularJS(アンギュラージェイエス)は、Googleとコミュニティによって開発されているオープンソースのJavaScriptフレームワークである。ブラウザ上で動作するウェブアプリケーションの開発にMVCアーキテクチャを取り入れることを目的としている。MIT L
この記事は賞味期限切れです。(更新から1年が経過しています) JavaScriptユニットテスト一年生の私が、Nettuts+ のチュートリアルで知ったテストツール 「testem」のお陰で大変捗ったので是非お勧めしたく、ここで紹介してみます。 testem ってなに testem via GitHub : airportyh/testem Unit testing in Javascript can be tedious and painful, but Testem makes it so easy that you will actually want to write tests. 要するに、面倒なJSのユニットテストをより快適にしてみんなでハッピーにテスト書こうよ!というツールです。 testem自体はnode.jsベースで動作し、Jasmine/QUnit/Mochaに対応して
Coding style is how your code looks and it is an important part of writing code as a professional. Whether you’re writing JavaScript or CSS or any other language, deciding how your code should look is an important part of overall code quality. When I was studying computer science in college, I had one extremely tough professor. His name was Dr. Maxey and he taught the more complicated courses like
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017. Learn moreSee full compatibilityReport feedback The Element.classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element. This can then be used to manipulate the class list. Using classList is a convenie
EssentialsApplication FrameworksMobile FrameworksMVC FrameworksRealtime FrameworksDesktop GUIServerSide LibrariesTesting FrameworksTemplating EnginesLoadersUIUI FrameworksWindows, Modals, PopupsKeyboard WrappersForm WidgetsUI ComponentsSliders & GalleriesNotificationsWYSIWYG EditorsTouchLayoutTours & GuidesMultimediaGame EnginesPhysics LibrariesAnimation LibrariesAudio LibrariesPresentation Librar
One of the many design goals of the JavaScript language was to keep it single-threaded and, by extension, simple. Though I must admit that, given the idiosyncrasies of the language constructs, it is anything but simple! But what we mean by being "single-threaded" is that there is only one thread of control in JavaScript; yes, sadly, your JavaScript engine can do only one thing at a time. Now, does
Tricks and techniques for making an HTML5 game. In this post, Eoin McGrath creates a very simple game that works on most smartphones as well as modern browsers. The great thing about these titles is that they work equally well on both mobile and desktop using the same code. Could HTML5 finally fulfill the holy grail of “write once, run anywhere”? Getting StartedBefore you start sketching the next
2maru.com 2018 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy
Nokia Developerより コアJavaScriptの落とし穴 evalやFunctionコンストラクタの使用を避けること evalやFunctionコンストラクタの使用は、ソースコードを実行可能なコードに変換しなければいけないので、毎回スクリプトエンジンを呼び出すことになる高価な演算である。 加えて、evalの使用時には文字列の文脈を実行時に解釈しなければいけない。 Using eval or Function constructor are expensive operations as each time they are called script engine must convert source code to executable code. Additionally, using eval the context of the string has to be i
エンジニアの坂本 一樹(@splhack)です。今日はみんなに新しいソリューションを紹介するね★ LWFっていうんだよっ♪ グリー、UnityおよびHTML5に対応したスマートフォンアプリの開発支援ソリューション「LWF」をオープンソースソフトウェアとして公開 「LWF」は、独自ファイルフォーマットに基づくアニメーションエンジンで、Flashコンテンツから変換したアニメーションデータを、UnityとHTML5で再生できます。 「Animal Days」での「LWF」使用例 (弊社プレスリリースより抜粋) ねっ、いいでしょ♥ ... すみません。書いてて辛くなってきたんで、もうちょっと堅くさせていただきます。 “新次元ゲーム開発セミナー”が開催! グリーの気鋭が語る、次世代のモバイルゲーム開発で求められるものとは? 坂本氏が講演で、「“Lightweight SWF”を“github”でオー
こんにちは、橋本です。 今回は小ネタを1つ紹介したいと思います。 画像投稿フォームを作る際に、投稿された画像を即時表示したいなんてことありませんか? そんなときに便利なのが、HTML5で追加されたFile API。 File APIを使えば、投稿された画像(正確には、選択されたローカルファイル)の情報を取得することができます。 では、画像投稿機能のサンプルを元に、File APIの使い方を見て行きましょう。 File API自体はjQueryと何の関係もありませんが、いろいろと面倒なので今回もjQueryを使っています。 サンプル <!DOCTYPE HTML> <html lang="ja"> <head> <meta charset="UTF-8"> <script src="http://code.jquery.com/jquery-latest.js" type="text/jav
Eric Wendelin is one versatile dude. When I met him he was writing Java at a small startup called Sun / Oracle, and now he's writing front-end code for a startup -- that's a big leap. With this responsive design post, Eric flexes a little muscle and shares his process for putting together a responsive website. Not long ago, the biggest challenge for a web engineer was making sites that worked well
A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS & tvOS e·jec·ta, noun – debris that is ejected during the formation of an impact crater Ejecta is like a Browser without the Browser. It's specially crafted for Games and Animations. It has no DIVs, no Tables, no Forms – only Canvas and Audio elements. This focus makes it fast. JavaScript code is executed directly by a JavaScrip
Back in July I wrote a post called JavaScript String Methods Reference, outlining many of the ways strings can be manipulated in JavaScript. Another area where JavaScript has a number of different methods available for use is Array manipulation, which I’ll cover in this JavaScript array methods reference. As usual, I’ll do my best to keep it simple and accurate, but if I’ve erred or if you think I
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く