navigation

Embedding a Thawte Site certificate seal with mootools in a DOM ready compliant way



unfortunately, we have no Thawte certificate ourselves so this demo will show the badge as 'invalid certificate'.


The problem with the Thawte Site Seals...


After having developed a site for a client, we were asked to include the THAWTE site seals that verify the site's authenticity. That is all fine, but the seal uses
<script src="https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe"></script>
tags and holds the DOM load, often causing a performance drop -- especially so if Thawte's server is running slow and your page waits on the DOMREADY event....

The solution for a nice clean seal: Get rid of the sealgenerator.exe

Remove the code supplied by thawte and replace with this goodness:
// written for mootools 1.2
window.addEvent("domready", function() {
    var doSeal = function(targetObject) {
        // show thawte seal code w/o the reference to their exe in a dom compliant way
        var loc     = window.location.href;
        var sealLoc = "https://www.thawte.com/core/process?process=public-site-seal-cert-details&public-site-seal-cert-details.referer=" + loc;
        new Asset.image("https://siteseal.thawte.com/site-seal/image?g5ff7fe3df88d8fafaa6035dc97152679ga45f4b102502fefbd20332591412323c" + (new Date()).getTimezoneOffset() + "g5d43a4e836d7d07a50759fb1da9cc900g1a0452b749ddb29083736b34ef4a14e9ga45f4b102502fefbd20332591412323c" + loc, {id: 'sealimage'})
            .inject(targetObject).addClass("cur").set("title", "click to verify").addEvent("click", function() {
                window.open(sealLoc,'ga3ef4eb41dcac740b918440eb9cd19c8','height=500,width=516,scrollbars=yes,status=1');
            });
    } // end doSeal

    // embed it...
    doSeal($("seal"));
});// domready

project box



Firefox 2

home | clients | contact us | pantone selector | photo story photo gallery