cannot get code to work

drphil111 Jun 22, 2012 11:08AM EDT

Here is a copy of my test html and the code does not work when i preview it in the browser. I am being stupid? What am i doing wrong? I am using coffeecup html editor and google chrome.

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml>
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Wed, 20 Jun 2012 11:15:27 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>

<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<style>

#content {
width:900px;
height:300px;
margin:30px;
padding:9px;
border:2px solid #1a1109;
background:#ffffff;
}
</style>

</head>
<body>


<div id="content">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4ec91bc768d4791c"></script>
<!-- AddThis Button END -->
</div>
</body>
</html>

1 Community Answers

Paul Jun 22, 2012 05:02PM EDT

You're probably viewing your pages by opening them as local files rather than loading them from a web server. So instead of the URL of the page in your browser starting with http:// it starts with C:\ or file://

Here's what the AddThis buttons look like when viewed via http:// - http://i.imgur.com/IDGUD.png

And here's the same file viewed using file:// - http://i.imgur.com/gpCco.png

We currently are using protocol-free URLs in our code - ones that start with // instead of http:// or https:// - to make sure our SSL implementations are cross compatible without extra work. However, if you're loading the test page with the file:// protocol it causes the CSS and other JavaScript files not to load, since it's looking for them on your local machine rather than our web servers.

I've submitted a ticket to our developers to fix this for people previewing pages using their file system rather than a web server, but until they can get that implemented you should either understand that the buttons won't show up if using the file:// protocol or use a web server in order to test how your sites display in browsers.


This question is closed to new answers.

Still need help?


General Topics

 

Developers