All jQuery Tips

Don’t use jQuery.size() to count number of elements

Here is a small quick tip for you that "Don't use jQuery.size() to count number of elements". Well jQuery provides .size() method, which returns number of element in the object. That means that you can count the number of elements within an object. For example, if you want to count total number of div elements […]
Read the rest of this entry »

Correct way to find out table row count with jQuery

Yesterday, I got into an interesting problem. There was an HTML table on my page and it was having 20 rows. When I was trying to get the count of no. of rows using .children() method but it was always giving me count as 1. For a while, I was wondering what is happening but […]
Read the rest of this entry »

Use jQuery.getScript to load external js files

jQuery provides a function called "getScript", which allows to load external Javascript or js file on the fly. The advantage of using $.getScript is that it loads the content on run time, which is far better than including <script> tag in your head section. jQuery getScript load a JavaScript file from the server using a […]
Read the rest of this entry »

Strip or remove all white spaces using jQuery

jQuery provides a function "trim" which removes the starting and trailing white spaces but the space (/s) within the string are maintained. So if you want to strip or remove all white spaces using jQuery then you can't use trim function. Then what is the solution? Well, You can use regex to find out the […]
Read the rest of this entry »

Various reasons and solutions of jQuery is not defined error

"jQuery is not defined" or "$ is not defined" is a very common error that you may face while working with jQuery or if you have started learning jQuery. The error message "jQuery is not defined" clearly says that it can't find the jQuery and you are trying to access jQuery's power. So in this […]
Read the rest of this entry »

How to check file size before uploading using jQuery

File uploading is a very common feature and It is always a good thing to know that what size of file is end user is uploading at the server. As it is quite possible that you don't want to allow users to upload huge files. So it is better to check the size of file […]
Read the rest of this entry »

Responsive Menu
Add more content here...