If you are using jQuery, Angualr JS or plain old JavaScript and getting "Uncaught ReferenceError: $ is not defined" error which means $ is either a variable or a method which you are trying to use before declaring it using var keyword. In jQuery, it's a short name of jQuery() function and most commonly used in $(document).ready(function()). If you are doing some jQuery stuff when DOM is loaded and getting this error it means your browser has a problem loading jQuery library either from the internet or local file system. In this article, you will see some of the most common reasons of "Uncaught ReferenceError: $ is not defined" error and how to solve them, but before that let's learn some basic about the dreaded Uncaught ReferenceError: $ is not defined error.
Read more »
Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts
Saturday, 9 April 2016
Monday, 22 February 2016
3 Examples to Get the Id of an Element in jQuery
As a page author, the id of an HTML element is something you should know, but there are scenarios when the page is automatically generated or may be some form elements are generated by using frameworks like JSF. In that case, what do you do if you want to find id attribute of some elements in the page programmatically? How do you find those ids using jQuery? There are several ways to solve this problem, a couple of them we'll see in this article itself. The jQuery API provides many methods to get any attribute or property including the id of an HTML element programmatically. In this article, I am going to share three easy ways to get the id of an element using jQuery.
Read more »
Subscribe to:
Posts (Atom)