IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.
Core/API/jQuery jQuery関数/$(...) jQuery(expression, context) CSSセレクターを受け取って、マッチしたエレメント集合のjQueryオブジェクトを返す。 jQuery(html, [ownerDocument]) HTML文字列を受け取ってDOM Elementを作成し、それらを含むjQueryオブジェクトを返す。 jQuery(elements) 受け取ったエレメントをjQueryオブジェクトにして返す。 jQuery(callback) $(document).ready()の短縮形。 jQueryオブジェクト操作 each(callback) 全ての要素に対してコールバック関数を実行する。 size() jQueryオブジェクトが持つ要素数を返す。 length jQueryオブジェクトが持つ要素数を保持する。 selector
よくある開閉するメニュー(リファレンスTOPでもやってます)の実装は、slideToggle()を使えば簡単に出来ます。 例えばこのサイトの左側に出ているメニューでは [HTMLソース] <div id="navi"> : <h4>API</h4> <ul class="sub"> <li><a href="/jquery/api/core/">Core</a></li> <li><a href="/jquery/api/selectors/">Selectors</a></li> <li><a href="/jquery/api/attributes/">Attributes</a></li> <li><a href="/jquery/api/traversing/">Traversing</a></li> <li><a href="/jquery/api/manipulation/">
【2024年8月】レンタルサーバーおすすめ10社を徹底比較! 人気ランキングも PR 最終更新日:2024年08月16日
時々、Webサイトで入力している内容をその場で判定するものがある。入力必須の項目やメールアドレス、パスワードの一致などでエラーがあればすぐに表示してくれるので、送信してから修正すると言った二度手間がなくて便利だ。 Webブラウザ上で入力チェックを実行する サーバ側でも入力チェックは行うが、ユーザビリティを考えるとオンラインでも検証したい。そんな検証システムを簡単に作れるのがyavだ。 今回紹介するオープンソース・ソフトウェアはyav、JavaScriptの入力チェックライブラリだ。 yavは入力必須はもちろん、数字のみや文字のみといったチェックもできる。メールや日付、文字の長さなどといったフォーマットによるチェックや、「and」と「or」による他の項目の値によって入力チェック内容を変更する機能もある。多言語にも対応している。 設定はこのようになる 入力フォーマットを規定することも可能で、予
メールアドレスチェック(正規表現) サンプルを見る<script type="text/javascript"> /** * [関数名] chkRegEmail * [機 能] 正規表現によるメールアドレス(E-mail)チェック * [引 数] * @param str 入力された文字列 * [返り値] * @return true(E-mail形式である場合) | false(E-mail形式でない場合) */ function chkRegEmail(str){ /* E-mail形式の正規表現パターン */ /* @が含まれていて、最後が .(ドット)でないなら正しいとする */ var Seiki=/[!#-9A-~]+@+[a-z0-9]+.+[^.]$/i; /* 入力された値がパターンにマッチするか調べる */ if(str!=""){ if(
業務システムを構築する際に、一覧表を表示するという処理は多い。そしてそのデータを並べ替えたり、チェックボックスを入れたりしたいというニーズも多く発生する。場合によってはカラムを並べ替えたり、一括更新したいなんて言われることもある。 ソートも並べ替えもページネーションも全部こみこみ それを一つ一つ実装していては非常に工数がかかってしまう。そこで使いたいのがこのSigma Gridだ。 Sigma Gridはテーブルの表示とソート、データ編集などを可能にする超豪華ライブラリだ。LGPLライセンスの下に公開されているオープンソース・ソフトウェアだ。 Sigma Gridはデータの表示に際してJSONでデータを渡す必要がある。そのため既存のシステムにそのまま組み込むのは難しいかもしれない。だがその変更してもあまりあるメリットを享受できるに違いない。 画像表示とクリックアクションの例 まずカラムごと
Drag and drop table content with JavaScript demo デモではテーブル内のコンテンツをドラッグ&ドロップでセル間の移動が可能で、配置したコンテンツの量でセルの高さも変更します。 スクリプトはjQueryなど他のスクリプトに依存せず単体で動作するもので、対応ブラウザはIE6をはじめFx3にも対応しています。
Web開発の現場において、データの並べ替え機能の要望は良く出る話だ。開発がある程度終わった段階で言われたりするとショックを受ける事もある。検索条件をパラメータで引き継いで、ページ番号も…なんて考えただけでも嫌になるだろう。 そんな経験のある、またはこれから経験するであろう方にお勧めのソフトウェアがある。これさえ使えばソート処理は怖くない。 今回紹介するオープンソース・ソフトウェアはTable Sorter、JavaScriptのみで実現するソートライブラリだ。 この手のライブラリはこれまでいくつかあったが、iframeを使ったり、表示に特定の手法が必要だったりと、そのままでは使いづらいものが多かった。Table Sorterはそれらの完成版ともいえるかも知れない。 何せ、読み込むのはJavaScriptファイル一つだけ、さらに普通のテーブルタグに対して、ヘッダ部分はtheadタグとthタグ
Google I/Oの基調講演で大きく取り上げられて以来、HTML 5に対する注目度は増すばかりだ。仕様に関する議論もWHATWGのメーリングリストで日々活発に行われ、ブラウザによる実装も着々と進んでいる。 本記事は、HTML 5の仕様や実装状況に関する現時点での最新レポートとして、実際に動作するサンプルを添えた詳細な解説をお届けするものである。HTML 5の仕様はまだまだ流動的であり、実装状況も刻一刻と変化しているが、HTML 5に対して強く興味を持っている方々に少しでも詳しい情報をお届けできれば幸いである。また、HTML 5で追加される各種の新機能について短時間で把握したい場合は、「5分で把握するHTML 5 - Google Developer Dayセッションリポート」という記事があるのでそちらもお薦めだ。 本特集は全2回から成り、前半となる今回では「HTML5 - HTMLとX
今回はJavaScriptとWebページの表示・操作の体感速度について考えてみます。というのは,JavaScriptのせいでWebページの表示や操作などの速度が遅くなっている,と感じることがあるからです。 現在のWebサイトでは,JavaScriptを使って使い勝手を向上することは,ごく当たり前に行われています。例えば,動的にページを書き換えたり,ページ遷移を行わずにサーバーと通信を行ってデータを取得したりと,JavaScriptを使うことで,Webサイトをより便利に,より使いやすくすることができます。 Ajaxという言葉がはやってから,もう2年以上がたつんですよね。何年か前,JavaScriptはじゃまで,セキュリティを低下させる不要なものだと見なされていた頃がありました。しかしそれから一変して,「JavaScriptをがんがん使ってもいい」という空気になったことで,Webサイトを作成す
JavaScript開発ツールの本命! FirebugとAptana:どこまでできる? 無料ツールでWebサイト作成(4)(2/3 ページ) ぜひとも活用したい「コンソール」と「スクリプト」画面 すでにFirebugをお使いの読者がFirebugでのJavaScript開発の際に特に便利だと感じるのは、「コンソール」と「スクリプト」画面ではないだろうか。 ロード時のバグがリストアップされる「コンソール」画面 まずは、コンソール画面。この画面を表示しておくと、ロード時のバグがリストアップされる。 例えば、図3はサンプルソースに「n5 =/ 1000;」という誤った構文を含めた状態でロードさせたものだが、「unterminated regular expression literal」というメッセージとともにその内容が表示されている。 ソースコードのエラー該当部分が分かる! また、エラー表示部
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く