Category : Javascript have tutorials for Javascript, here you can study articles of Javascript, Javascript posts collection, most popular and useful tutorials of Javascript, here you can find list of all relevant posts and example about Javascript, we have lists of tutorials and examples about Javascript.very simple and quick example collection of Latest Javascript category.

JQuery - Display loading image on ajax call example

Sometimes, we want to display loading image or animation or text when fire every ajax request. In not for only one ajax request, but if you want to load image on every ajax request then you can do that using bellow example. I use ajaxStart() and ajaxComplete() function for show image until All POST or GET Ajax request. this both function will execute one each $.ajax request. <strong class="example">Example:</strong> <pre class="prettyprint lang-js"> <script type="text/javascript"> $(document).ready(function() { $(document).ajaxStart(function(){ $('#process_img').cs.....

By Hardik Savani | April 12, 2016 | | 29833 Viewer | Category : Javascript

Jquery ajax request example

If you are very fresher in jquery and you don't know how to work post ajax request then bellow example can help you. i gave you the example of POST ajax request with json, you can also easily modify this example. you also fire GET ajax request using this example. bellow example is a pretty simple to undestand how to work $.ajax method. so let's see bellow example and try to undestand. <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> <html lang="en"> <head> <title>JQuery Ajax Demo</title> <script src="

By Hardik Savani | April 10, 2016 | | 19647 Viewer | Category : Javascript

How to parse json in jquery ajax?

When you are working php or .net etc and you return data like json_encode($data) on ajax request. but in front side you get like a string at that time you have to parse json object and get them. so, let's see example and learn how to use: <strong class="example">Example</strong> <pre class="prettyprint lang-php"> var request = $.ajax({ type: 'POST', dataType: 'json', url: '', data: {token:obj['token'],postid: obj['postid']} }); request.done(function(msg) { msg = JSON.parse(msg); msg.forEach(function(items) { var e = "notify-"+items.userid; .....

By Hardik Savani | April 5, 2016 | | 25200 Viewer | Category : Javascript

How to create scroll to top of the page by jquery animate ?

However you want the scrolling process to have animated effect. you have to follow bellow example. in this post you can add button for scrolling top with animate effect. Most of website you can see with one button left side or right side for scrolling top of the page. so, if you want to create on your site then you have to add following jquery code: <strong class="example">Example</strong> <pre class="prettyprint lang-html lang-js"> <style type="text/css"> #toTopImg{ position: fixed; bottom: 20px; left: 20px; cursor: pointer; display: none; z-index.....

By Hardik Savani | March 26, 2016 | | 18930 Viewer | Category : Javascript

How to remove particular value from jquery array?

When i was working on my code PHP project, at that time i need to remove specific items value from my javascript array. i did google search and solve that but i would like to share in my site how to remove value from javascript array. so, let's see how to use: <strong class="example">Example:</strong> <pre class="prettyprint lang-js"> var languages = ['php', 'laravel', '.net', 'java', 'c#', 'javascript'] var deleteLanguage = 'laravel'; languages = jQuery.grep(languages, function(value) { return value != deleteLanguage; }); console.log(languages); </pre>

By Hardik Savani | March 23, 2016 | | 15203 Viewer | Category : Javascript

How to remove undefined value from jquery array?

If you have jquery or javascript array with lots of undefined value and you want to remove all undefined value from array. you can remove undefined items from your array without using each loop you have to just use filter, I would like give the example how to remove undefined element from javascript array. so, let's see bellow example. <strong class="example"></strong> <pre class="prettyprint lang-javascript lang-html"> <script type="text/javascript"> var obj = ['3','3','5',undefined,'hi']; obj = obj.filter(function(e){return e}); console.log(obj); </script> </pre>

By Hardik Savani | March 12, 2016 | | 22007 Viewer | Category : Javascript

How to redirect page using JQuery?

You can redirect page or url in your js file. when you require to redirect page form jquery thrn you can use window.location.href. window.location.href through you can redirect url using jquery/javascript. So, Let's see following example: <strong>Example:</strong> <pre class="prettyprint lang-js">window.location.href = "";</pre>

By Hardik Savani | March 10, 2016 | | 18707 Viewer | Category : Javascript

Multi select autocomplete jquery example with code

In this post i show you how to use autocomplete with multiple select option by jquery. I think you will did autocomplete for single option using jquery ui plugin. but in this post you can learn multi selection autocomplete using jquery ui. In bellow preview you can see how will output of your multiselect autocomplete because its like choose js or something like plugin. But for layout i just add my own css. this example i use jquery ui js file and one more multiselect js file that file through we can do multi select and one more thing you can also customization of autocomplete.multiselect.js fi.....

By Hardik Savani | March 8, 2016 | | 70069 Viewer | Category : Javascript

PHP Image upload without refreshing page using jquery example

In this post i show you how to image upload without page reload using jquery ajax. jquery ajax through you can upload image and store record into database in php. i use jquery.form plugin for image uploading. So you can do by following few step of file uploading ajax jquery. <strong>Preivew</strong> <img width="100%" style="border:2px solid red" src="/upload/imageupload.png"> <br/> First you have to create index.php file as i do in following file, so create index.php file and put bellow code. <strong>index.php</strong> <pre class="code language-html"> <html lang="en"> <head> <ti.....

By Hardik Savani | March 4, 2016 | | 44213 Viewer | Category : Javascript

How to use each loop with class element of html in Jquery?

Whenever you need to use each loop in jquery then you can follow this example code. each with html class you can get whole object of that class using $(this) jquery function. In following example you can see i get attribute data-id using $(this).data('id'), that means you can take current class data attribute value. <strong>Example:</strong> <pre class="code language-html"> <html lang="en"> <head> <title>Each Loop with Class Jquery</title> <script src=""></script> </head> <body> .....

By Hardik Savani | March 4, 2016 | | 16306 Viewer | Category : Javascript