Go to any page on stackoverflow.com, open firebug (or use some other html searching feature), and put in "everyonelovesstackoverflow" into the search bar. There's one div in the html with that class (second child of the sidebar), its contents are thus:

<div class="everyonelovesstackoverflow">
        <script type="text/javascript">
            document.write('<s'+'cript lang' + 'uage="jav' + 'ascript" src="http://ads.stackoverflow.com/a.aspx?ZoneID=4&amp;Task=Get&amp;IFR=False&amp;PageID=52405&amp;SiteID=1&amp;Random=' + (+new Date()) + '">'); 
        </script><script src="http://ads.stackoverflow.com/a.aspx?ZoneID=4&amp;Task=Get&amp;IFR=False&amp;PageID=52405&amp;SiteID=1&amp;Random=1259617729992" language="javascript"/><a rel="nofollow" target="_Blank" href="http://ads.stackoverflow.com/a.aspx?Task=Click&amp;ZoneID=4&amp;CampaignID=64&amp;AdvertiserID=7&amp;BannerID=21&amp;SiteID=1&amp;RandomNumber=2015326516&amp;Keywords="><img width="220" height="250" border="0" align="Center" alt="Free book on best practices for peer code review at codereviewbook.com - Smart Bear Software" src="http://ads.stackoverflow.com/ads/freebook.png"/></a><br/>
            <a href="http://ads.stackoverflow.com/a.aspx?ZoneID=4&amp;Task=Click&amp;Mode=HTML&amp;SiteID=1&amp;PageID=52405">
            <img src="http://ads.stackoverflow.com/a.aspx?ZoneID=4&amp;Task=Get&amp;Mode=HTML&amp;SiteID=1&amp;PageID=52405" alt="">

What in the world is this? My first question is why in the world you'd use javascript to write a <script> tag (in little pieces?) into a document. When I put in ads.stackoverflow.com, it takes me to a login for a stackoverflow advertising page, so I'm guessing they're references to a script that shows an ad on the page.

But perhaps foremost I'm asking if this is a bug. Its an odd name for a div on this well designed site, and the div never seems to have any content. ever. The only other reference I've found to this div is this question, in a greasemonkey script that reverses the reduced advertising when you hit 200 rep, so I thought it was an add. I've disabled ad-block plus and greasemonkey, logged out, and visited the site, and the div still has the same source-code, but nothing ever appears in it. Can anyone else see an ad in that div? (as my cookies or other factors could be interfering with what I see). This just smells weird, can anybody give an explanation?

EDIT: OK, now I see the ad. Maybe I'm just being an idiot,

1 Answer 1


The "<script> in fragments" thing was weird to me too, but I asked on Twitter and this is still standard. Apparently certain HTML validators freak out if they see "tags" inside your script. I researched it at the time and it's legit, but I can't remember all the details at the moment.

Here's your answer.. from this "Stack Overflow" site, whatever the heck that is.

Script tag in JavaScript string

  • 4
    And since when you care about validators?
    – Vinko Vrsalovic StaffMod
    Commented Nov 30, 2009 at 23:31
  • not just validators, I couldn't remember all the reasons. See the post. Commented Dec 1, 2009 at 4:13
  • The scripts just won't work. Some browsers look for the word <script and automatically prevent it from inclusion in the dom. Commented Dec 1, 2009 at 4:18
  • 1
    A more interesting question is why the javascript is pulled form stackoverflow.com rather than sstatic.com Commented Dec 1, 2009 at 4:19
  • Oh, and you can see this with google, too. It's how the google analytics scripts work. Commented Dec 1, 2009 at 4:20
  • 1
    ...hmm... maybe I shoulda just added my own answer :) Commented Dec 1, 2009 at 4:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .