3 years, 4 months ago
HTML+JAVA+ADSENSE: Why does my ad only show when I load the file locally?
I have a web page with a table-based image map. In one of those slots, I'd like to display an adsense ad.
If I directly load the index.html into firefox or chrome, the ad displays properly.
The moment I upload the page to my website, the ad disappears.
Any ideas why?
...
<td width="728" height="90" colspan="7">
<script type="text/javascript">
<!--
google_ad_client = "<REDACTED>";
/* Leaderboard */
google_ad_slot = "<REDACTED>";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
...
Chrome provides this error either way: Resource interpreted as script but transferred with MIME type text/html. I have no idea what this means.
Thanks.
If I directly load the index.html into firefox or chrome, the ad displays properly.
The moment I upload the page to my website, the ad disappears.
Any ideas why?
...
<td width="728" height="90" colspan="7">
<script type="text/javascript">
<!--
google_ad_client = "<REDACTED>";
/* Leaderboard */
google_ad_slot = "<REDACTED>";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
...
Chrome provides this error either way: Resource interpreted as script but transferred with MIME type text/html. I have no idea what this means.
Thanks.
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$1 Answer
As a first approach to the problem, you may want to contact your web host about and make sure their configurations aren't interfering.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$
Ahh.... perhaps you're developing on a Mac.....?
Glad you got it going. Thanks for the tip.