Current time: 05-28-2018, 07:44 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defer Loading of Verisign Seal
09-25-2010, 02:58 AM (This post was last modified: 09-25-2010 03:06 AM by jarrod1937.)
Post: #1
Defer Loading of Verisign Seal
I have this code to load the verisign trust seal:

Code:
<div style="margin-left:auto;margin-right:auto;margin-bottom:6px;width:100px;height:72px;overflow:hidden;">
<table width="100" border="0" cellpadding="2" cellspacing="0" title="Click to Verify - This site chose VeriSign Trust Seal to promote trust online with consumers." >
<tr>
<td width="100" align="center" valign="top"><script type="text/javascript" src="https://seal.verisign.com/getseal?host_name=factorydirectcraft.com&amp;size=S&amp;use_flash=NO&amp;use_transparent=YES&amp;lang=en" ></script></td>
</tr>
</table>
</div>

However, its adding around 700 ms to my page load time. Partially because it opens up an ssl connection to verisign to serve the seal image. I've attempted to add the defer="defer" attribute, this causes it to not even render in firefox. I've also done a document.getElementById("verisignload").src="https://seal.verisign.com/getseal?host_name=factorydirectcraft.com&amp;size=S&amp;use_flash=NO&amp;use_transparent=YES&amp;lang=en" to an onload event with the id applied to the script tag that had an empty src attribute, and it also does nothing. When i did this i did an in browser javascript and found that the src was indeed set correctly, leading me to believe the script itself just didn't execute.
I do have another item i am deferring with this code:

Code:
function fbl(){
document.getElementById("facebookiframe").src="http://www.facebook.com/plugins/like.php?href='.urlencode(FULLURL).'&amp;layout=standard&amp;show_faces=true&amp;width=350&amp;action=like&amp;font=arial&amp;colorscheme=dark&amp;height=80";
}

window.onload=function(){
fbl();
}

And that works fine, though it is a iframe element so that may be why. I've also tried one of the methods found online for appending an element to a child, and it did not work.
So anyone have any ideas on how to defer the verisign seal script? Worse case scenario i'll probably keep the seal. Its presence adds more value to an ecommerce site than the speed.
Find all posts by this user
Quote this message in a reply
09-28-2010, 06:13 AM (This post was last modified: 09-28-2010 06:15 AM by sajal.)
Post: #2
RE: Defer Loading of Verisign Seal
I looked at the javascript at https://seal.verisign.com/getseal?host_n...mp;lang=en

It uses the nasty document.write which means you cant defer it. The script has to execute at the exact moment you need it to be shown.

However, the work around could be by placing this :
Code:
<div style="margin-left:auto;margin-right:auto;margin-bottom:6px;width:100px;height:72px;overflow:hidden;">
<table width="100" border="0" cellpadding="2" cellspacing="0" title="Click to Verify - This site chose VeriSign Trust Seal to promote trust online with consumers." >
<tr>
<td width="100" align="center" valign="top"><script type="text/javascript" src="https://seal.verisign.com/getseal?host_name=factorydirectcraft.com&amp;size=S&amp;use_flash=NO&amp;use_transparent=YES&amp;lang=en" ></script></td>
</tr>
</table>
</div>

inside a separate html file and load it via an iframe.

You could also make this new iframe wait for onload (or not) ...

Please test the iframe method properly before settling on it tho... links in that widget *may* open in the iframe...

The best solution would be convincing verisign to rewrite their javascript such that they dont use document.write

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
09-28-2010, 07:13 AM
Post: #3
RE: Defer Loading of Verisign Seal
Wow, can't believe i missed that its using document.write... would have prevented me from trying all of those other methods. I'll experiment with the iframe method, though it does sound a bit hacky. I'll see what verisign says, since they offer the seal to also improve search engine click through rates, having them make their code perform faster should be an easy sell job now that speed counts in ranking (however little). Thanks for the help!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)