Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQueryのロード機能を使いたい
私は書くことができます:$('#somediv').load('somefile.html #aSpecificDivinThatPage');
$('#somediv').load('somefile.html #aSpecificDivinThatPage');
HTML ページのソース div として変数を使用したいのですが、どのように書き出すのですか?
通常の文字列連結を使用できます。
var div = '#aSpecificDivinThatPage'; $('#somediv').load('somefile.html ' + div);