文档讨论了使用 WebSocket 和 Socket.IO 创建实时聊天应用程序的基本实现。它包含了设置服务器、监听连接和处理消息的代码示例。还提到了使用 Pusher 作为消息推送的替代方法。

文档讨论了使用 WebSocket 和 Socket.IO 创建实时聊天应用程序的基本实现。它包含了设置服务器、监听连接和处理消息的代码示例。还提到了使用 Pusher 作为消息推送的替代方法。
先日、ちょっとした思いつきで WebKit の Nightly Build をインストールし、 WebGL を試してみました。 WebGL というのは現在策定中の新しい規格で、 JavaScript を使って本格的な 3DCG を実現する API です。同じ目的を持つものとして Google の O3D がありますが、 WebGL は OpenGL ES を管理している Khronos グループを中心に Google, Mozilla, Opera, NVIDIA, AMD といった企業が参画しており、標準化という面ではリードしています。 まだ策定中の規格なので今後変化するかもしれませんが(WebGL 1.0 が正式リリースされました)、少なくとも現状の WebKit の実装については使い方がわかったので、本日はそれをご紹介します。 WebGL は Web 上の最も重要なグラフィックス A
豚を丸焼きにするイベントで日焼けしました。ago(@kyo_ago)です。 すでにだいぶ時間がたってますが、7/7に弊社コーポレートサイトのリニューアルを行いました。 その際会社までの道順を紹介するページでGoogle Mapのデザインを変更したのでその方法をご紹介したいと思います。 StyledMapType Google Map Ver3以降はStyledMapTypeというAPIが追加されており、このStyledMapTypeを使うことで地図上の指定された要素に対して独自の色情報を設定することができます。 色の変更方法 色を変更するにはStyledMapType API経由で以下のようにJavaScriptのObjectを渡すことで実現できます。 var styles = [ { // 色を変更する対象の指定(document参照) featureType: "road.local"
We can’t change history, but we can change the future. Be nice to each other. @robertnyman Published on Wednesday, August 3, 2011 When the AJAX wave came in 2005 when Jesse James Garrett coined the term and then everyone wanted it, one of the major shortcomings was that dynamic updates of only portions of a web page lead to inconsistent history handling and back/forward navigation button problems
node.js+Socket.IOでリアルタイムアプリケーションが作れるわけだけど、WebSocket使うにしてもXHR-Polling使うにしてもサーバ経由して通信していれば当然タイムラグはあるわけで、それってどれくらい遅延するものなんだろう? と思っていろんなサーバで試してみた(追記しました)。 測定方法 var server = require('http').createServer(function (req, res) { require('data-section').get('html', function (err, data) { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end(data); }); }); var io = require('socket.io').listen(server);
追記 たくさん反響があって驚きました。念の為書いておくと、私はこの記事で仕組みを解説しただけで、このようなノウハウに賛成も反対もしていません。追記はここまで。 azu さんのつぶやきで知った、Dangers of anonymous function closures が、例がよいのに説明が少ないので、ここで丁寧に解説します。なぜ、 jQuery で ;(function () ...とセミコロンで始めるコードがあるのかがわかります。 次のサンプルの実行結果を想像して下さい。 var foo = function(bar) { console.log("foo"); return bar; } (function(){ console.log("bar") })(); 結果は "foo bar" を印字します。多くの場合、これは意図しない挙動だと思います。"bar" だけだと思いませんか。
ElevationServiceを利用すると、Elevation APIから高度情報を取得できます。 ここでは、ElevationServiceのgetElevationForLocations()メソッドの利用例を紹介します。 サンプル このサンプルは、getElevationForLocations()メソッドを利用して2地点のサンプルを取得しています。 <!DOCTYPE html> <html> <head> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map { height: 100% } </style> <script src="http://maps.google.com/maps/api/js?v=3&sensor=fals
Webデザイナーでもできる、サイトのパフォーマンスをあげる5つの方法 2011-08-28 Webデザイナーが、Webサイトのパフォーマンスを重視する傾向はあまり無いように感じますが重要なことです。 Googleでは、0.5秒遅くなると、検索数が20%減少する amazonでは、0.1秒遅くなると、売り上げが1%減少する という報告もあるようです。Webサイトのパフォーマンスはコンバージョンにも影響する大切な部分。 今回はWebサイトのパフォーマンスを上げる方法を取り上げます。 パフォーマンスアップの前に 応答時間の限界 0.1秒までなら、結果はコンピューターではなく、ユーザーによって引き起こされたように感じる。 1秒までなら、"遅れている"と感じるが、ユーザーの思考は途切れずに、自由に動いていると感じる。 10秒までになると、ユーザーがコンピューターに振り回されている気持ちになり、ストレ
Ever wanted to notify your site clients/users while they are surfing in your site? notifications like “Mail message arrived”, “Printer out of paper” are available through smart clients for decades but in web applications they are not so easy to implement. In the past you could have implemented a blinking behavior that will make the icon of the browser blink or you could add a popup which will anno
前の翻訳記事でも述べらているけど、やっぱりデザイナーもプログラミングはある程度書けたほうがいいと思う。んで、その言語はJavaScript! O’ReillyさんからJavaScriptを学ぶうえで役立つ本をまとめた電子書籍(JavaScript Bibliography)が公開されているのを教えてもらったのでAmazonリンクを張ってみるポスト。こう見てみると、翻訳されていないJS本いっぱいですね(気づいてないのもありそう…)。原書の方はKindle版も売ってますので、円高のアレもあるのでYOU買っちゃったらいいんじゃないの! JavaScript Bibliography - O’Reilly Media Beginning JavaScript
jQuery is a coding language, which works like JavaScript. This light weight JavaScript library is very easy to use and has features which helps you work in a better, quick and more efficient way. The best jQuery effects are its drop down menus, drag and drop elements, animations and form validation. You do not need to use Flash now for animation it can simply be done by jQuery now. jQuery is also
Daftar Serta Masuk Saat ini Di Situs Slots Online Terpilih Ojekslot Seperti yang kita pahami waktu ini ada sangat banyak permainan slot online paling sederhana yang dapat dimainkan dalam sekejap hanya cukup masuk di sana saja ojekslot terunggul. Di sini dapat ada sangat banyak bermacam permainan luar biasa yang pastinya dapat anda temukan dengan ringan. Beraneka permainan terbaik di sini dapat and
Advanced JavaScript Compression JavasScript minification made easy The JavaScript compressor has optional advanced features to give you even further control over how you compress your JavaScript. For those that want extra control over their scripts you have the option to compress in 4 different formats: high ASCII, numeric encoding, normal encoding and even no encoding at all. One click is all you
This document discusses JavaScript testing with tools like Capybara. It mentions that Capybara allows testing web applications by simulating user behavior like clicking and filling forms. It provides details on different backends for Capybara, including those based on Selenium, envjs, and PhantomJS. It also discusses using Capybara with JavaScript code coverage tools like JSCoverage.
はじめに JavaScriptで文字列を反転する10の方法を(無理矢理?)思いついたので、ちょっと簡単に紹介したい。また、それぞれについて、各ブラウザでパフォーマンスを測定してみたので、その結果も合わせて載せる。 文字列のStringオブジェクトには、部分切り出し(substring, slice)や置換(replace)、連結(concat)など豊富な機能があるのに、反転(reverse)機能はない。Arrayのreverseはあるのに、Stringのreverseがないのはどうしてなのだろうか。 各ブラウザとそのバージョンは以下の通り: Chrome Firefox Opera Safari IE 13.0.782.112 m 6.0 11.50 5.1(7534.50) 8.0.7600.16335 rev01: C言語的発想 空の配列を作って、そこに元の文字列の後ろから1文字つづ入
@hebikuzureさん主催のブラウザー勉強会に参加してきました。今回のお題は「ブラウザーとWebが描く『夢』」ということで、最近のHTML5などの直近技術的な話題だけではなく、今後の社会の変化を踏まえたお話をFirefox、Opera、IEの中の人に伺うといった他の勉強会ではなかなかないような興味深いテーマです。 勉強会でつぶやかれた内容はTogetterでまとめてあります。 第3回 ブラウザー勉強会(#BrowserWS)のまとめ 具体的な勉強会の内容は下につらつら書いていきます。 午前の部 コミュニティーセッション セッション(1)「Testで始まる物語(ストーリー) QUnit CUIの紹介」by Kyo Agoさん(@kyo_ago) UST http://www.ustream.tv/recorded/16762261 発表資料 http://jsrun.it/kyo_ago
日頃より楽天のサービスをご利用いただきましてありがとうございます。 サービスをご利用いただいておりますところ大変申し訳ございませんが、現在、緊急メンテナンスを行わせていただいております。 お客様には、緊急のメンテナンスにより、ご迷惑をおかけしており、誠に申し訳ございません。 メンテナンスが終了次第、サービスを復旧いたしますので、 今しばらくお待ちいただけますよう、お願い申し上げます。
ウェブサイトを作成する際に個人的に使っているWebサービスを紹介します。幅広く35個紹介しますので、新しい発見があれば幸いです。 フォント関係 wordmark.it パソコンに入っているフォントを一覧で見ることができます。フォントサイズも調整できます。 日本語フォント252種類を表示確認できます!フォントを探すならfonthack.jp。 日本語フォントの表示が確認できます。現在252種類あります。 PXtoEM.com: PX to EM conversion made simple. ベースのサイズ(px)を決めると、em, pt, %の値が表示されます。 カラー関連 ウェブ配色ツール Ver2.0 配色ツールは色々ありますが、日本語ですし、あまり考えなくても感覚的に使えるので楽しいです。 Color Scheme Designer 3 カラーパレットジェネレーターです。海外サイトで
My Background <canvas> entered my awareness in 2006 when Firefox v2.0 was released. An article on Ajaxian, describing the transformation matrix, inspired me to create my first <canvas> web-app; Color Sphere (2007). Which immersed me into the world of colors, and graphic primitives; inspiring the creation of Sketchpad (2007-2008) in an effort to put together an application "better than Paint" in th
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く