下記内容の『外部JSファイル』を呼び出しているのですが
広告が表示されません。
下記内容に不備ありましたら、ご指摘お願いいたします。
document.write("<div align='center'>")
document.write("<p>")
document.write("<script type='text/javascript'><!--")
document.write("google_ad_client = 'hogehogeID';")
document.write("/* 200*200 */")
document.write("google_ad_slot = 'slotnumber';")
document.write("google_ad_width = 200;")
document.write("google_ad_height = 200;")
document.write("//-->")
document.write("</script>")
document.write("<script type='text/javascript'")
document.write("src='http://pagead2.googlesyndication.com/pagead/show …")
document.write("</script>")
document.write("</p>")
document.write("</div>")
広告が出ないというか、google_ad_widthとgoogle_ad_heightの値が渡っていないようです。
よろしくお願いいたします。
A 回答 (1件)
- 最新から表示
- 回答順に表示
No.1
- 回答日時:
これはどうしてdocument.write()が必要なのでしょうか?
そのまま""内にあるHTMLの記述を書くだけで動くと思われます。
書き出しが不必要なものまで書かれているので、document.write()が根本的に不要なのではないでしょうか。
この回答への補足
ご回答ありがとうございました。
>これはどうしてdocument.write()が必要なのでしょうか?
質問ソースは一部抜粋でして、他にPHPで処理した内容をdocument.write()で書き出し
htmlからJAVAスクリプトとして呼び出し動かしています。
本来であれば、PHPで直接出力といきたいのですが
質問ソースの手法でしか実現できない環境のため困っています。
どうにか質問ソースの手法で実現できないでしょうか。
よろしくお願いいたします。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
- ・ゆるやかでぃべーと タイムマシンを破壊すべきか。
- ・歩いた自慢大会
- ・許せない心理テスト
- ・字面がカッコいい英単語
- ・これ何て呼びますか Part2
- ・人生で一番思い出に残ってる靴
- ・ゆるやかでぃべーと すべての高校生はアルバイトをするべきだ。
- ・初めて自分の家と他人の家が違う、と意識した時
- ・単二電池
- ・チョコミントアイス
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
複数ブラウザ対応のお気に入り...
-
○歳△ヶ月と×日を計算してくれる...
-
for文のiを使ってリンク先のア...
-
<form>タグを使って...
-
ブラウザによるCSSの切替スクリ...
-
トラブルの解決方法をご存知の...
-
window.openでタイトル名の指定
-
配列
-
innerHTMLにて設定した情報を再...
-
ウェブ上にキーボードを作りた...
-
問題の個数を数える。
-
関数でy=g(x)のgとは何の略です...
-
複数ファイルで使うグローバル...
-
ジェネレーターの作り方
-
Linux バイナリ実行できない "...
-
<a>タグのテキストを取得
-
C#で、ContextMenuStripに動的...
-
gas スプレッドシートがアクテ...
-
重複しないくじの作り方がわか...
-
ローカルにあるファイルを検索...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
window.openでタイトル名の指定
-
○歳△ヶ月と×日を計算してくれる...
-
JavaScriptとHTMLの課題です
-
ホームページに日付を自動更新...
-
なぜ、ジャバスクリプトが表示...
-
配列を使って平均を求めるプロ...
-
引数を渡さずに呼び出し元の変...
-
for文のiを使ってリンク先のア...
-
javascriptとphpの連携で疑問
-
document.write()の()内にタグ...
-
document.writeで画面が消える
-
JAVAで時刻に対して簡単な四則...
-
現在の日付から、1ヶ月前にす...
-
カレンダーをプログラミング
-
初歩的なことなんですけど
-
document.write内のタグ
-
今日の月と日付の1週間後や3日...
-
Javascriptのfunction文がわか...
-
来年の今日の曜日・・・?
-
Java Scriptのメソッドについて
おすすめ情報