views:

38

answers:

0

I'm trying to load a StatCounter tracking script after the form has been successfully sent. Here's the code:

$.ajax({
  type: "POST",
  url: "css/sendmail.php",
  data: dataString,
  success: function(data) {
    $('#script').load('css/script.html', function() ({
      $('#overlay').css('visibility','hidden');
      clearForm();
   $('#alert').slideDown().delay(5000).slideUp();
    });
  }
});

This is the tracking script:

<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=3886809; 
var sc_invisible=1; 
var sc_security="05496a3d"; 
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;div class="statcounter">
<a title="visit tracker on tumblr" href="http://www.statcounter.com/tumblr/" target="_blank">
<img class="statcounter" src="http://c.statcounter.com/3886809/0/05496a3d/1/" alt="visit tracker on tumblr" ></a></div></noscript>
<!-- End of StatCounter Code -->

I checked my stats and it works. The only problem is that the code is being executed twice. The first one shows up as "http://example.com/index.html" and the second one as "http://example.com/index.html#".