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
4
votes
2 answers

Uncaught ReferenceError: (function) not defined at HTMLButtonElement.onclick

The following functions, onColourChange and onWindowChange, should cycle through images on button click. Instead, I get both: Uncaught ReferenceError: onColourChange is not defined at HTMLButtonElement.onclick and Uncaught ReferenceError:…
AlxTay
  • 41
  • 1
  • 1
  • 3
4
votes
3 answers

Why is no ReferenceError being thrown if a variable is used before it’s declared?

I’m trying to wrap my head around the behavior of reference errors thrown in JavaScript. In the following example, a ReferenceError is thrown at the second line, and execution breaks: var obj = {}; obj.func1 = func2; alert('Completed'); Whereas in…
4
votes
2 answers

Unable to display AdMob Banner

I am trying to ad using AdMob to display ads at the bottom of screen. I added following line in my build.gradle file to get AdMob sdk: compile 'com.google.android.gms:play-services-ads:8.4.0' After then, I added AdView in XML to show…
4
votes
1 answer

Cannot pass optional parameter into express after defining it

I have my optional parameter defined using my param function below, but when I try Postman passing in the optional parameter I get a Reference Error 'off' is not defined. I can't figure out how to use the value I pass in for the parameter in the…
Rafa
  • 2,566
  • 3
  • 31
  • 58
4
votes
1 answer

getScript creates ReferenceError

I have some js scripts that I load into my main.js before I start the rest of my code. However during testing it came to my attention that sometimes it creates the following reference error (1 in 8 pageloads or something). ReferenceError:…
4
votes
1 answer

Uncaught ReferenceError: url is not defined

So I created a an iphone out of pure css and I am trying to make the screen change on click to make it interactive. I am new to java script, just started learning about it a week or so ago, and browser is telling me "Uncaught ReferenceError: url is…
4
votes
3 answers

call export function in Node.js

I am new in node.js I did try this function ( foo.js ) module.exports.hello = function hello(name) { console.log("hello " + name); } hello('jack'); but I have this error node foo.js ReferenceError: hello is not defined
monkeyUser
  • 2,858
  • 6
  • 29
  • 62
4
votes
2 answers

jQuery Waypoints error "notify is not defined"

Yes, I know this probably has nothing to do with waypoints. I'm sorry. I am following this example: http://imakewebthings.com/jquery-waypoints/#get-started Here is my very simple javascript:
Buttle Butkus
  • 8,409
  • 13
  • 73
  • 110
3
votes
1 answer

Javascript typeof throws referenceerror

lets get right into it. I am using typeof to check if a variable API exists. I learned that typeof returns "undefined" if the variable does not exist. function exitApplication() { let typeOfApi = typeof API; if (typeOfApi !== "undefined") { …
Lukas
  • 269
  • 2
  • 12
3
votes
2 answers

Jest - ReferenceError: imported function is not defined

I have been at this for 2 hours now, but couldn't figure out what I am doing wrong. I have following jest+puppeteer test: import {convert} from '../__helpers__/number'; const getAmount = async (page) => { const element = await…
Gopikrishna S
  • 1,856
  • 3
  • 19
  • 32
3
votes
1 answer

ReferenceError: $ is not defined when debug

I have this error message ReferenceError: $ is not defined when using vscode built-in debugger node.js Here is the html 14. Getting Started with jQuery On IE and FF it works fine, but on Safari (at least Safari 4.0.5) it says “ReferenceError can't…
adam
  • 31
  • 1
  • 1
  • 2
1 2
3
31 32