6

I've never encountered anything like this before, so I'm hoping someone else has and can explain it to me.

I'm working on a site containing some Adsense banners. In order to keep them from showing up on my localhost or any of my test accounts, I created some server-side code to generate and serve an alternative div with a background image from a CSS file. It's a hack of the Labnol.org responsive design code for Adsense.

Anyway, I have a pair of lines in there like this (the div with the ID is an ASP.net control):

sampleImg = $("<div></div>").addClass("sample-ad-320-x-50");
$("#ctl00_Page_Footer_Top_Leaderboard_Sample").append(sampleImg)

In my CSS, I have:

div.sample-ad-320-x-50 {width:  320px;  height:  50px;  background:  URL(../common-images/banner-ad-320-x-50.gif) center center no-repeat #C0FF00;}

The child div itself loads, but I see this in the Resources window within Chrome:

banner-ad-728-x-90.gif /ss2013/common-images GET (failed) Pending jquery-1.9.1.min.js:3 Script 13 B 0 B

49 ms

I can view the image itself in Chrome...but not when it's loaded in a div (or in an image tag, for that matter).

I know the background is there, because it loads fine in Firefox. I also know the background is there because I can copy/paste the link from the Resources window into a browser and see it that way.

I don't know what could possibly be causing this...is this a jQuery thing or a Chrome thing? I suspect it's a Chrome thing.

SEFL
  • 539
  • 4
  • 15
  • Here is my attempt to recreate the situation... [http://jsfiddle.net/4C9Fa/](http://jsfiddle.net/4C9Fa/) ... My question is what is different about my code that is different than yours? or what needs to happen to actually re create your situation. May you can help me reproduce it? – Joseph Apr 02 '13 at 16:10
  • 1
    might be an ad-blocking plugin. see [here][1] [1]: http://stackoverflow.com/questions/5585918/what-does-pending-mean-for-request-in-chrome-developer-window – Lior Jun 17 '13 at 18:06
  • Check respond headers and console – VeeeneX Aug 09 '14 at 22:21

1 Answers1

1

the url in your css should have single quotes:

div.sample-ad-320-x-50 {width:  320px;  height:  50px;  background:  url('../common-images/banner-ad-320-x-50.gif') center center no-repeat #C0FF00;}
Brian
  • 903
  • 1
  • 7
  • 13