<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>h13i32maru</author_name>
  <author_url>https://blog.hatena.ne.jp/h13i32maru/</author_url>
  <blog_title>maru source</blog_title>
  <blog_url>https://blog.h13i32maru.jp/</blog_url>
  <categories>
    <anon>tech</anon>
  </categories>
  <description>HTMLの文字列をXHRで動的に取得してきて、それをdocument.bodyなんかに突っ込む場合があると思います。 その時に文字列中にscriptタグが含まれる場合、elm.innerHTML = html;ってしてもscriptは実行されません。 jQuery.fn.loadはそのへんが考慮されていてscriptも実行してくれます。で、どうやってるのかなーとコード読んでみたのでそのメモ。 取得したHTML文字列を一旦div.innerHTMLに入れる div.childNodesをfragmentに順番にappendChildする fragmentからquerySelectorAll('s…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.h13i32maru.jp%2Fentry%2F2013%2F11%2F28%2F225335&quot; title=&quot;HTML文字列に含まれるscriptを実行する - maru source&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-11-28 22:53:35</published>
  <title>HTML文字列に含まれるscriptを実行する</title>
  <type>rich</type>
  <url>https://blog.h13i32maru.jp/entry/2013/11/28/225335</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
