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.
純粋な JavaScript の jquery の書き換えに問題があります
parent.$("#data-store").data('text')
JSで同じことをどのように表現できますか?
jQuery でデータを設定していないと仮定すると、次のようになります。
parent.document.getElementById('data-store').getAttribute('data-text');
jQuery でデータを設定すると、属性としてではなく内部の jQuery キャッシュに格納され、jQuery キャッシュ オブジェクトを読み込まないと取得できません。内部 javascript オブジェクトの読み取りに関心がある場合は、jQuery.cache という名前が付けられています。