How can we get Execute Javascript to work on Chrome? It returns Uncaught Reference Exception

It works when I execute it in Chrome’s console but it doesn’t work when executing in KM, it returns with an “uncaught referenceError”.

I made a short 17 video.

Thank you.


You’re using jQuery (not vanilla JavaScript) to select the a (anchor tag) and change its color.

The “$” is an alias to jQuery.

  • This: $('a').css('color, 'red');
  • Is the same as: jQuery('a').css('color, 'red');

"$ is not defined" means the jQuery library has not been loaded.

But you probably already knew all of that.

I tested this in Chrome and got the same error. But it works in Safari 9.1.

I don’t know why. I’d be interested to know why as well.
And since that was your original question, this post of mine means almost nothing :slight_smile:

This is a “security feature” of Chrome, marked currently as “wontfix” with only lame workarounds.

Damn… if only Safari had favicons I wouldn’t be use chrome again.