0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JavaScriptでの様々なメソッド

Posted at

#配列をJSON形式で引き渡す場合
jbuilder:array! メソッドです。
これで配列をjson形式で引き渡すことができます。
この記法は非同期通信で検索機能の実装を施す時に使うことが多いです。
以下、サンプル

json.array! @tweets do |tweet|
  json.id tweet.id
  json.text tweet.text
end

#キーボードを話した瞬間に起こるイベント
keyupメソッドです。
これも検索機能に大きく関わってきます。
検索ボックスに文字を入れると勝手に予測変換が出てきますよね。
これはkeyupの効果です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?