user230013
user230013

Reputation: 19

Why does the icon from Brazen Careerist trigger a SCRIPT1014 error in Internet Explorer?

I put in this link to my profile on Brazeen Careerist on my web page (www.ctrlaltm.com). Whenever I load this page in any version of IE, I get the following error:

SCRIPT1014: Invalid character
widget_tracking.1.js, line 6 character 39

The code for the icon came from Brazen Careerist (http://www.brazencareerist.com/help/badges/icon) and is the following:

<a id="sicon-bclink" name="My Brazen Careerist Social Resume" href="http://www.brazencareerist.com/profile/maggiet?utm_source=22088&utm_medium=single&utm_campaign=icon"><img border="0" alt="My Brazen Careerist Social Resume" src="http://static.brazencareerist.com/v6/ui_widget/icons/icon_bc.png"/></a>
<script type="text/javascript">var bctrk_cat = "icon";var bctrk_act = "SingleView";var bctrk_uid = "22088";</script> 
<script src="http://static.brazencareerist.com/v6/ui_widget/widget_tracking.1.js" type="text/javascript"></script>

I checked the debugger in IE9's developer tools but when I checked where the error had happened all it said was the problem was line 6, character 39 which pointed to a left quotation mark. This didn't make any sense to me. The only potential problem I could think of was when I changed the & to & a m p ; (spaces added only here to show the character entity) in the original link to get to validate under HTML 4.01 Strict it messed up the JS somehow but I'm not sure why that would happen.

Upvotes: 1

Views: 215

Answers (2)

Sampson
Sampson

Reputation: 268492

This isn't a problem with Internet Explorer, nor is it exclusive to Internet Explorer. Opening the same page up in Chrome reveals the following in our console:

Uncaught SyntaxError: Unexpected token ILLEGAL ... widget_tracking.1.js:6

Same message you're getting in the IE console too. When we look at this section, we find that you have slashes before the double-quotes, which is wrong.

var bcPageTracker = _gat._getTracker(\"UA-3762378-1\");

Change to:

var bcPageTracker = _gat._getTracker("UA-3762378-1");

Of course, once you fix this you're going to be met with the next error: SCRIPT5009: '_gat' is undefined. This is because you attempted to join two script tags into one .js file. My advice is for you to download your tracking code again, paste it into the footer of your site, and not tamper with it any further.

This is how you're supposed to use this code:

  <!-- Google Analytics Code -->
  <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-3762378-1");
    pageTracker._initData();
    pageTracker._trackPageview();
  </script>
  <!-- End Google Analytics Code -->
</body>

Upvotes: 2

Musa
Musa

Reputation: 97727

This is line 6, if you look real hard you'll see the invalid character
var bcPageTracker = _gat._getTracker(\"UA-3762378-1\");

Upvotes: 0

Related Questions