ユーザ用ツール

サイト用ツール


jqueryとは

文書の過去の版を表示しています。


jQueryとは

NiftyCloudMobileBackendと直接関係はありませんが、Javascriptでソースコードを検索していると、たとえば、

// htmlファイル
<!-- 以下の div 要素のクラスを取得したい -->
<div id="test" class="sample sample-test">
 ...
</div>
// javascriptファイル
// jQuery で取得する場合
console.log($('#test').attr('class'));

といった、“$”マークをよく見かけます。これは、多くの場合、jQueryというjavascriptライブラリを用いた記載方法らしく、

// JavaScript で取得する場合(jQuery 未使用)
var target = document.getElementById('test')
console.log(target.getAttribute('class'));

//もしくは以下でもオッケー
console.log(document.getElementById('test').getAttribute('class'));

という意味だそうです。

http://www.mdesign-works.com/blog/web/javascript-jquery/

【初心者向け】JavaScript と jQuery を混同しているあなたのために
Web
2015.10.06

jqueryとは.1529219146.txt.gz · 最終更新: 2018/10/07 (外部編集)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki