Quantcast
Channel: 楽天 みんなで解決!Q&A 新着質問([技術者向] コンピューター/205)
Viewing all articles
Browse latest Browse all 29232

getElementsByTagNameが使えない

$
0
0
javascriptで下記コードを書いて動的にmetaタグを作成しようとしたところ うまくいきませんでした。調べていたところgetElementsByTagNameは safariではうまく動かないという記述があったのですが この関数に替わるものもしくはその他の方法はありますでしょうか。 var meta = document.createElement("meta"); meta.setAttribute("name", "ad-banner"); meta.setAttribute("content","test-id=xxxxx"); document.getElementsByTagName("head")[0].appendChild(meta);

Viewing all articles
Browse latest Browse all 29232

Trending Articles