Questions tagged [referenceerror]

Anything related to JavaScript ReferenceError that it is thrown when trying to dereference a variable that has not been declared.

The JavaScript ReferenceError object represents an error when a non-existent variable is referenced. A ReferenceError is thrown when trying to dereference a variable that has not been declared.

470 questions
729
votes
39 answers

Uncaught ReferenceError: $ is not defined?

How come this code throws an Uncaught ReferenceError: $ is not defined when it was OK before? $(document).ready(function() { $('#tabs > ul').tabs({ fx: { opacity: 'toggle' } }); $('#featuredvid > ul').tabs(); }); Results in tabs don't…
Olivers
  • 7,499
  • 4
  • 15
  • 6
146
votes
4 answers

Uncaught ReferenceError: ytcfg is not defined (also __ytRIL is not defined)

I have been using the YouTube IFrame Player API without problem for months and started to see this exception recently when the player loads: Uncaught ReferenceError: ytcfg is not defined Inspecting the iframe, I see a successful call to…
Thomas Vanier
  • 1,298
  • 2
  • 7
  • 7
38
votes
8 answers

socket.io - ReferenceError: io is not defined

I am writing an application for Android 2.3.5 (that will also be compatible with iOS). I wish to transfer data from the app's HTML/Javascript to a Python program on a server (which uses the Twisted engine to retrieve the data). I've tried many…
Ness
  • 1,215
  • 1
  • 9
  • 18
38
votes
2 answers

How can I compare a non-existing JavaScript object to undefined without getting a Reference Error?

I want to boolean to come out of this expression (task === undefined); where task is arbitrary and doesn’t appear in the code at all. However, when I run this in rhino, I get a reference Error. I WANT TRUE Why don’t I get true? I want to check if a…
Fawkes5
  • 881
  • 3
  • 8
  • 10
24
votes
11 answers

d3 is not defined - ReferenceError

I am trying to use a "fancy graph" found at http://bl.ocks.org/kerryrodden/7090426: The way I've done it was to download the code and simply edit the CSV file to match my data. Then I simply open the .html-file in Firefox to see the interactive…
pir
  • 4,475
  • 7
  • 47
  • 84
24
votes
4 answers

How to catch NetworkError in JavaScript?

In Chrome's JavaScript console, if I run this: var that = new XMLHttpRequest(); that.open('GET', 'http://this_is_a_bad_url.com', false); that.send(); I get an intentionally expected error: NetworkError: A network error occurred. I want to catch…
Synthead
  • 1,777
  • 4
  • 18
  • 25
24
votes
8 answers

$(document).ready(function(){ Uncaught ReferenceError: $ is not defined

Hi I am having a "Uncaught ReferenceError: $ is not defined" while using bellow codes I am currently getting the following error in my log. I have been looking at the samples in the framework and I just can't seem to find where the error is. It's…
Monika Milosavich
  • 241
  • 1
  • 2
  • 3
17
votes
2 answers

"Foundation - ReferenceError: primordials is not defined when starting a foundation zurb project."

Getting an error when creating a Foundation Zurb project. Tried to solve using the previous suggestions shown for other applications, but none are working. A post referenced updating elm, and I did so, however, it did not work. Additionally, I…
Leigh277
  • 171
  • 1
  • 1
  • 6
16
votes
1 answer

Is it a bug in firefox developer edition?

Take a look at the below code: var c = 50; { console.log(y); let y = 50; } This code is expected to throw a ReferenceError and it does. But in the console, the message attached with the exception just blown my mind. It…
16
votes
4 answers

ReferenceError: Can't find variable: $

I am using jQuery. This is my coding on my main page: and my script.js is: $(document).ready(function(){ $("#title").click(function () { alert("Works!"); }); }); My…
Cheetaiean
  • 527
  • 1
  • 4
  • 18
14
votes
3 answers

ReferenceError on Google Chrome but not on Firefox (Browser Bug?)

This piece of code eval(` let a = 0; function f() {} function g() { a; } console.log(f); `); works fine on Firefox 48.0 while causing Uncaught ReferenceError: f is not defined on Google Chrome 52.0.2743.116 (64-bit). It also…
johnchen902
  • 9,200
  • 1
  • 25
  • 63
14
votes
3 answers

JavaScript Uncaught ReferenceError: jQuery is not defined; Uncaught ReferenceError: $ is not defined

This is my fiddle, http://jsfiddle.net/4vaxE/35/ It work fine in my fiddle. However, when I transfer it to dreamweaver, it can't work. And I found this two error in my coding. Uncaught ReferenceError: jQuery is not defined uncaught referenceerror…
Soo
  • 211
  • 1
  • 2
  • 8
14
votes
5 answers

Uncaught ReferenceError: $ is not defined

I am getting this error message when trying to create a JQuery image slider. Uncaught ReferenceError:$ is not defined Here is my NEW coding (NOTE that I have moved the script to the of the page, this was suggested by adobe.) :
MasterFuel
  • 319
  • 2
  • 3
  • 13
14
votes
3 answers

ReferenceError: GM_xmlhttpRequest is not defined

I get a ReferenceError in the following userscript code: // ==UserScript== // @name ... // @namespace ... // @description ... // @include ... // @grant GM_xmlhttpRequest // ==/UserScript== console.log(GM_info); try { …
Kendall Frey
  • 39,334
  • 18
  • 104
  • 142
13
votes
5 answers

Why does typeof only sometimes throw ReferenceError?

In Chrome and Firefox, typeof foo evalulates to 'undefined'. But typeof (function() { return foo; })() throws an error: ReferenceError: foo is not defined This destroys the notions that I have of susbstitutability of expressions! Until now, I…
Paul Draper
  • 64,883
  • 37
  • 172
  • 246
1
2 3
31 32