Processing
 

Uncaught Reference Error: stLight is not defined (in Chrome only)

22/04/2013 04:16#1

Joined at: 12 months ago

Post: 7

Thank: 0

Thanked: 0

My web page ends thus:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript">var switchTo5x=false;</script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript"> stLight.options({publisher: "ur-24e62f76-1f66-e3aa-1190-c533b729ca11", doNotHash: true, doNotCopy: true, hashAddressBar: false}); </script> <script type="text/javascript" src="/static/bootstrap/js/bootstrap.js"></script>   </body> </html> 

In FireFox and Safari, it behaves. In Chrome:

Uncaught ReferenceError: stLight is not defined nectar-tugg-art:229 (anonymous function) 

In other words, the code at w.sharethis.com/button/buttons.js has failed to execute, and hence, failed to define the stLight variable.

The page is part of a Django web application running on a remote server. Saving the generated HTML page locally, then viewing in Chrome, works correctly.

At this point I'm stuck. Something to do with the cross domain security model? There aren't any security exceptions.

Some weird interaction with the other javascript files?

The static (generated) code is here. It won't run from Dropbox though.

22/04/2013 04:35Top#2

Joined at: 12 months ago

Post: 7

Thank: 0

Thanked: 0

Ok, think I may have found it: the site runs fine in Chrome's incognito (porn) mode. So I strongly suspect I've got some kind of extension that's interfering with it (like Do Not Track or something).

EDIT It's Collusion's "block known tracking sites" feature.

28/06/2014 07:43Top#3

Brett

Member

Joined at: 12 months ago

Post: 71

Thank: 0

Thanked: 0

In my case I found it to be a Chrome plugin called "Disconnect". Thanks to @SteveBennet for the clue.

07/01/2016 05:30Top#4

Bimal Dev

Member

Joined at: 9 months ago

Post: 1

Thank: 0

Thanked: 0

In my case I replaced

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> 

this by

<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script> 

ShareThis

20/01/2016 17:45Top#5

Joined at: 9 months ago

Post: 2

Thank: 0

Thanked: 0

In Magento stLight is not defined: This can be resolved by following: <script type="text/javascript"> window.onload = function(){ stLight.options({publisher: "ur-24e62f76-1f66-e3aa-1190-c533b729ca11", doNotHash: true, doNotCopy: true, hashAddressBar: false});} </script>

Issue (I think) is js file http://w.sharethis.com/button/buttons.js load after the script in which this function exists. so easiest solution in my mind is window.onload, may have other good solutions.

20/06/2016 23:08Top#6

Joined at: 12 months ago

Post: 4

Thank: 0

Thanked: 0

This can be caused by the Ghostery extension, in addition to the extensions listed in the other answers.

Similar articles

Chrome, THREE.js: Cross-origin image load denied

5 years ago - Reply: 5 - Views: 271

Prevent Google Chrome Log XMLHttpRequest

3 years ago - Reply: 5 - Views: 277

How can I include ChromeDriver in a JAR?

3 years ago - Reply: 3 - Views: 83

Chrome geolocation not working on any site

3 years ago - Reply: 1 - Views: 49

wrong borders' width in android browser

3 years ago - Reply: 4 - Views: 207

Uncaught SyntaxError: Unexpected token < On Chrome

3 years ago - Reply: 10 - Views: 472

Flashdata not getting cleared in Codeigniter

4 years ago - Reply: 5 - Views: 58

Illegal access Javascript error in Chrome

3 years ago - Reply: 1 - Views: 53

ng-repeat not updating in Chrome

3 years ago - Reply: 1 - Views: 82

Applying border to a checkbox in Chrome

4 years ago - Reply: 2 - Views: 119

open browser plugin using access vba

3 years ago - Reply: 1 - Views: 26

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re