View Single Post
Old 07-22-2011, 05:58 AM   PM User | #1
hom
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
hom is an unknown quantity at this point
check 404 of a javascript

Hello, I have never used javascript before, so this might be a very basic question. I have a script on my blog which places a stumbleupon button on the page.

This is the code that calls the script:

Code:
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
Today I went to my blog and it was taking a long time to load, it turns out because stumbleupons site is down so the script can't be accessed. A whole lot of other stuff on the page just doesn't load until it times out though, so it takes like 3 minutes for the page to load.

What I want to know is can I test if the script is reachable and only call it if it is, so that if there is a 403 or 404 error it just won't even try to load it and continue loading the rest of the page??

Any help is greatly apprectiated!

Thanks.
hom is offline   Reply With Quote