Populate Select2 with AJAX data based on X event

In this post, I would like to show you data populating in select 2 dropdown based on x event and it will get data from the remote server using Http protocol, the same technique you can apply for dependent dropdowns to show data based on the selection. Populate Select2 with AJAX data example In the… Continue reading Populate Select2 with AJAX data based on X event

Get selected Text and Value of DropDownList using jQuery

This tutorial illustrates about getting selected Text and Value of HTML Select DropDownList on Button click using jQuery. The following HTML Markup consists of an HTML Select DropDownList and a Button.

Now add jQuery to footer of the page.

Final and import step, let’s bind click event handler to the button and read… Continue reading Get selected Text and Value of DropDownList using jQuery

Scroll to top JQuery

scroll-to-top-jquery

When you have web page too long, it is recommended to provide your users easy navigation mechanism.You we can provide it in many ways like fixed navigation at top and left or right navigation panels..etc. Here I am gonna show you quick trick called “Scroll to top”. Basically by using this, user can easily reach… Continue reading Scroll to top JQuery

JQuery Foreach Example

jQuery Foreach Each Example

Foreach provides easy way to iterate over the arrays, objects. Foreach is the most important control structure in any language. So i am going to write a simple comprehensive tutorial on JQuery’s $.each() function.I would like to show you example on how to loop through an array ,object,JSON and DOM elements. jQuery.each() syntax jQuery.each( array,… Continue reading JQuery Foreach Example

Published
Categorized as JQuery

How to check / uncheck all check boxes using jQuery?

How to check / uncheck all check boxes using jQuery?

You may have noticed select/deselect all functionality on websites like gmail.com, outlook.com or even in the wordpress admin dashboard basically which allows you to select all emails or posts on the page with single click. Which can be convenient to have check / uncheck multiple checkboxes with single click especially if the list is vast.… Continue reading How to check / uncheck all check boxes using jQuery?

jQuery Copy To Clipboard

ZeroClipboard is a library that provides you with a way of coping text to your clipboard using Adobe flash and a Javascript interface. Flash can access your computers clipboard because you have to install flash and agree to the security settings, therefore we have to use flash to access the clipboard. We can use Javascript… Continue reading jQuery Copy To Clipboard

Published
Categorized as JQuery

JQuery Ajax form submit Example

Sending Ajax requests to server with JQuery library is pretty easy. We just need to include JQuery in your page after that we can use JQuery’s ajax API methods in the page. Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use… Continue reading JQuery Ajax form submit Example

Published
Categorized as JQuery

Check if Object is empty in Javascript

To check if an object is empty in JQuery we use jQuery.isEmptyObject( object ) with will return true on success , false on failure. Ex :

To check if an object is empty or not using Javascript we use Object.getOwnPropertyNames() .The Object.getOwnPropertyNames() method returns an array of all properties (enumerable or not) found directly… Continue reading Check if Object is empty in Javascript