Current time: 06-06-2020, 06:15 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Facebook's "like" button
06-25-2010, 06:50 AM (This post was last modified: 06-25-2010 07:34 AM by jarrod1937.)
Post: #3
RE: Facebook's "like" button
Yep that worked perfectly. Times are now back to around 1.70-1.80 seconds. Thanks for the help!
Although i used window.onload so it wouldn't interfere with any of the site loading, worked perfectly:
http://www.webpagetest.org/result/100624...1/details/
Actually i may need your help one more time. I am also attempting to defer a .js file until after the page is loaded. At first i tried appending a script to the DOM but found that it didn't place it where i needed it (a button is placed wherever the .js file is loaded). So i figured i'd try the same method you suggested above:

PHP Code:
<script id="deferloading"></script>
<
script type="text/javascript">
window.onload=function(){
document.getElementById("deferloading").src="http://example.com/share.js";
}
</
script

But for whatever reason that does not work, it doesn't even attempt to download the .js file. However if i remove the onload event it works:

PHP Code:
<script id="deferloading"></script>
<
script type="text/javascript">
document.getElementById("deferloading").src="http://example.com/share.js";
</
script

But i am not sure why the event would cause it to not load at all. Any ideas?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Facebook's "like" button - jarrod1937 - 06-25-2010, 04:57 AM
RE: Facebook's "like" button - jarrod1937 - 06-25-2010 06:50 AM
RE: Facebook's "like" button - jarrod1937 - 06-25-2010, 07:58 AM
RE: Facebook's "like" button - jarrod1937 - 06-26-2010, 12:37 AM
RE: Facebook's "like" button - sajal - 06-29-2010, 05:41 AM
RE: Facebook's "like" button - sajal - 06-29-2010, 06:25 AM

Forum Jump:


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