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 を使用して iFrame の URL を取得する方法について誰かが何か考えを持っているかどうか疑問に思っています。
たとえば、自分のページに iFrame があり、誰かがその iFrame 内の Web サイトをスクロールしている場合、現在の URL を取得する軽量な方法があります。
誰かがもう一度尋ねなければならない場合。埋め込みのあるコンテンツを再描画/変更したいので、jqueryを使用してsrcを取得し、再度書き直さなければなりません。直接セレクターを使用できるようにするには、iframe を事前に含める必要があります。
var iframeSrc = $('.article-content iframe:first-child').attr('src'); console.log(iframeSrc);
これが役立つかどうか教えてください。