Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Uncaught ReferenceError: function is not defined

// This is hard error to solve
// There are some cases
// 1. Your javascript code blocks have scope problem.
// 2. You may have syntax error like forget "," before Ajax request:
$.ajax({
	url: requestUrl,
    headers: { "token": token }  // no comma error here
    ...
)}

// 3. In html tag `onClick` should change to id or class:
$(document).ready(function() {
    $("Some id/class name").click(function(){
        // your function can execute
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Uncaught #function #defined
ADD COMMENT
Topic
Name
6+2 =