SkyHorse.Org

HTTP and HTTPS tags without using JavaScript

Very neat trick I found out recently is that if you omit the protocol from an HTML src tag it will use the same protocol as the current URL, which is ideal if you need to have one universal HTML tag that works with both HTTP and HTTPS without having to use JavaScript tricks to detect the protocol.
This is great to use with ad server tracking pixels for example, or any other images:

Standard HTML code:
<img src="http://www.google.co.uk/intl/en_uk/images/logo.gif">

Relative protocol version:
<img src="//www.google.co.uk/intl/en_uk/images/logo.gif">

A few important details:

  • The browser will use the same protocol for the image call as the base URL where the tag is on, akin to a relative-path URL. This means e-mail clients and the sorts (like file explorers) will not be able to use this (as there is no base URL)
  • Tested on IE6 + 7, FF2 + 3 and Safari 2 + 3.
  • Syntax is part of the HTML spec since 1995, just not widely used (don’t know why)
Tags: online-advertising, Web Design

Related posts:

  • The state of Online Advertising 2.0 – part 1: Microhoo?
  • What is… Behavioural Targeting? Part I: Contextual, Re-targeting and Interest-based targeting
  • Deep Packet Inspection takes another blow

This entry was posted on Tuesday, November 11th, 2008 at 7:44 pm and is filed under Computing, online media. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Top tips for flying in comfort and style
How does your website look like under Dillo 0.8 on a FreeBSD? »

One Response to “HTTP and HTTPS tags without using JavaScript”

  1. Manuel Padilha Says:
    November 12th, 2008 at 4:20 pm

    Useful! Thanks.

Leave a Reply

  • Tags

    AI apple behavioural-targeting business christianity Computing cPanel deep packet inspection design Downloads Games GNU/Linux google hacking hacking Hardware headphones hosting Ideas Instant Messaging iphone islam marketing online-advertising online media Personal Philosophy phorm poker Programming satire scripts Security sociology startups technology Travel ubuntu v-moda Visionarism web-2.0 web-marketing Web Design WHM wunderloop
  • Pages

    • About
    • Web Server Administration
      • Auto update modsecurity rules – modsec.sh
      • DirectAdmin to cPanel : a partial BASH solution
      • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
        • Configuring E-mail (Exim) related areas
        • Fixing open DNS servers
        • Monitoring your server
        • Scripts and misc information
        • Security by Obscurity
        • Tweaking apache web server
  • Twitter Updates

    • Ads

    • RSS NMA

      • Sofia's Diary 3 attracts 1.8m views 9 July, 2009
      • We7 tops 2m users 8 July, 2009
      • Rivals.net closed without warning 8 July, 2009
    • RSS Brand Republic

      • Information Commissioner's Office spotlights database breaches in News of the World mobile phone tap row 9 July, 2009
      • Lida hires two for Boots Advantage Card work 9 July, 2009
      • DMGT's Motors.co.uk enters partnership with Parker's 9 July, 2009
    • RSS iMedia Connection: Consumer Strategies

      • Why Twitter can do more harm than good
      • Why agencies' social media use doesn't matter
      • 5 mistakes to avoid when launching a viral campaign
    • RSS Behavioural Targeting news

      • Behavioural Targeting and Privacy - Searchcowboys 9 July, 2009
      • Cover story: Industry fails to allay consumer fears over ... - New Media Age 8 July, 2009
      • What Do BT And Copyright Infringement Have In Common? - MediaPost Publications 8 July, 2009
      • US trade bodies agree to self-regulate behavioural advertising - Out-Law.com 7 July, 2009
      • Q Interactive Announces Acquisition of Postmaster Direct - PR Newswire (press release) 7 July, 2009
    • RSS Adotas

      • DeLonghi brand fail spotlights Amazon review scams 9 July, 2009
      • Google Chrome operating system gambit 9 July, 2009
      • AOL media future = TMZ 9 July, 2009
    • RSS MarketingVox

      • EyeWonder's PageMorph 'Manipulates' Site Content 9 July, 2009
      • Industry Buzz & Snippets: 07/09/09 9 July, 2009
      • Digital M&A Deal Value Dives 61% in First Half 2009 9 July, 2009
    • RSS SimsCity blog

      • Attaching pixels to pages 2 January, 2009
      • Frequency capping 28 December, 2008
      • ITV player 27 December, 2008
    • RSS Donald Hamilton

      • Online ad spending bucks trends 29 September, 2008
      • Ad:Tech 25 September, 2008
      • Phorm in the clear? 18 September, 2008
    • RSS Segmentacion por comportamiento

      • Microsoft refuerza sus capacidades de segmentación mediante BT. 12 June, 2009
      • La importancia del Behavioural Targeting en Inglaterra. 1 June, 2009
      • The RightMedia Problem, The Microsoft Lesson, And Why OpenX Will Eventually Win 29 May, 2009
    • RSS Sandlines

      • Behavioural targeting and online publishers 23 April, 2009
      • What’s the French for ‘teaser campaign’ 22 April, 2009
      • Gmail dot hell 27 March, 2009
    • RSS ladig.net

      • Mit „Behavioral“ den optimalen Werbe-Weg finden 8 May, 2009
      • Mit ToDo und Toodledo das Chaos beherschen 6 May, 2009
      • Die PS auf die Strasse bringen! 30 April, 2009
    • Ads

    • Blogroll

      • 90kts
      • Acxiom Poker Nights
      • Amy’s blog
      • Bytter’s blog
      • morena flor no samba da saudade
      • Not Quite There Yet
      • Swedish Pirate Party
    • Cartoons

      • Geek & Poke
      • Order of the Stick
      • User Friendly
    • Gaming

      • Neverwinter Nights
    • online media

      • Knowledge for the Digital Economy
      • Mike on Ads
    • Personal

      • Atelier de Camisa
      • Banksy
      • Designarte
      • My Amazon Wishlist
      • SkyServers.Org
    • Science

      • New Scientist
      • Rex Research
      • ScienceBox
      • Wired
    • Security

      • GPG4Win
      • GPGol
      • GPGShell
      • Mod Security
      • Offline Windows NT(2k,XP) Password Recovery
    • Web Design

      • PageStrength
      • SiteScore
      • UrlTrends
    • Akismet

      48,304 spam comments
      blocked by
      Akismet
    • 28 day stats


      1,111
      Unique
      Visitors
      Powered By Google Analytics

    © 2003 - 2009 Paulo Cunha | SkyHorse.Org is proudly powered by WordPress | Theme based on Bob