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.

542 questions
830
votes
40 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 close…
Olivers
  • 8,509
  • 4
  • 17
  • 6
147
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,348
  • 2
  • 9
  • 7
45
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
  • 1,001
  • 3
  • 9
  • 12
41
votes
11 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,415
  • 1
  • 13
  • 19
31
votes
12 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
  • 5,513
  • 12
  • 63
  • 101
29
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
  • 2,162
  • 5
  • 22
  • 25
27
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
  • 271
  • 1
  • 3
  • 3
23
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
  • 901
  • 1
  • 12
  • 26
19
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
  • 191
  • 1
  • 1
  • 6
17
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
  • 241
  • 1
  • 3
  • 8
17
votes
6 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
  • 349
  • 2
  • 3
  • 13
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
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
  • 43,130
  • 20
  • 110
  • 148
15
votes
2 answers

Catch a referenceError in js

I have a textarea where user can enter javascript code which upon press of the button would be passed to eval(). I am having trouble catching the referenceError for cases when a user enters something like this: var myName = Maria; instead of var…
jacobdo
  • 1,605
  • 3
  • 15
  • 34
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,531
  • 1
  • 27
  • 69
1
2 3
36 37