Tuesday, May 08, 2012

Godaddy SSL Site Seal Slow To Load - Solution

This is the godaddy.com site seal that
on a site secured by SSL would display
a popup of the certificate when clicked
When a website is secured with an SSL certificate from godaddy.com, a javascript code is given by godaddy to be placed on the website that when clicked displays a popup window with the SSL certificate details.

The problem is, that it can cause the page to load slowly, as the javascript makes various calls to check for flash and it is from the godaddy server, so if godaddy is being slow, then it will effect your website...not great. (This can happen when relying on any external javascripts, such as "addthis" code etc)

The solution to this is to stop your page from calling the godaddy javascript until the entire page has loaded (including images). This way, users of the site will not be aware of it happening, the page will load as usual and once finished then the godaddy seal code will run.

To do this, you need to save the godaddy javascript, which you can get by placing the url given in the godaddy code

for example :
https://seal.godaddy.com/getSeal?sealID=XXXXXXXXXXXXXXXXXXXXXXXXXXX

Paste it into your browser address bar, go to that page and view the source code to grab the javascript. Alternatively simply save page as.

The first line of that code is a call to the functions
seal_installSeal();

So comment that out or delete it, but take note of it as you will need it later.

Upload the javascript to your web server and note its location.

Then link to that inside the <head> tags of the webpages you want to show the seal.
<script src="path/to/godaddyseal.js" type="text/javascript"> </script>

Then wherever you want to show the seal on your website, you will need to put the following code..

<script type="text/javascript">
//call after page loaded
window.onload=seal_installSeal();
</script>