David Meador has Published 164 Articles

How to append an element after an element using jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:16:45

2K+ Views

To append an element after an element using jQuery, use the insertAfter() method.ExampleYou can try to run the following code to learn how to append an element after an element using jQuery:Live Demo           The jQuery Example                 ... Read More

How to manipulate CSS pseudo-elements ::before and ::after using jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:15:13

2K+ Views

To manipulate CSS pseudo elements using the hover() function. You can try to run the following code to learn how to manipulate CSS pseudo-elements −ExampleLive Demo $(document).ready(function(){     $('span').hover(function(){     $(this).addClass('change').attr('data-content', 'bar'); }); }); span.change:after {     content: attr(data-content) ' This ... Read More

How to get a style property on the matched element using jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:14:33

277 Views

To get a style property on the matched element, use the css() method. You can try to run the following code to get a style property on the matched element using jQuery:Live Demo $(document).ready(function(){   $("#button1").click(function(){     alert($('div').css('left'));   }); }); This is demo text. Get

What is the difference between ajaxSend() and ajaxStart() functions in jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:13:18

301 Views

ajaxSend() methodThe ajaxSend(callback) method attaches a function to be executed whenever an AJAX request is sent.Here is the description of all the parameters used by this method:callback − The function to execute. The XMLHttpRequest and settings used for that request are passed as arguments to the callback.Assuming we have the following ... Read More

What is the difference between ajaxStop() and ajaxComplete() functions in jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:11:19

611 Views

ajaxStop() methodThe ajaxStop( callback ) method attaches a function to be executed whenever all AJAX requests have ended.Here is the description of all the parameters used by this method −callback − The function to execute.Assuming we have following HTML content in result.html file:THIS IS RESULT...ExampleThe following is an example showing the usage ... Read More

What is the difference between ajaxSuccess() and ajaxComplete() functions in jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:09:45

265 Views

ajaxSuccess() methodThe ajaxSuccess( callback ) method attaches a function to be executed whenever an AJAX request completes successfully. This is an Ajax Event.Here is the description of all the parameters used by this method −callback − The function to execute. The event object, XMLHttpRequest, and settings used for that request are ... Read More

What is the difference between Local Events and Global Events in jQuery?

David Meador

David Meador

Updated on 15-Jun-2020 09:08:05

1K+ Views

Ajax requests produce a number of different events that you can subscribe to. There are two types of events:Local EventsThese are callbacks that you can subscribe to within the Ajax request object.$.ajax({    beforeSend: function(){       // Handle the beforeSend event    },    complete: function(){     ... Read More

How to disable some jQuery global Ajax event handlers for a request?

David Meador

David Meador

Updated on 15-Jun-2020 09:06:07

295 Views

Use the global error handler to receive a few of the parameters that jQuery can provide. After that add the suppressErrors: true.  You can try to run the following code to disable some jQuery global Ajax event handlers for a request:Live Demo $(document).ready(function(){   $("div.log").ajaxError(function(evt, xhr, ... Read More

How to handle jQuery AJAX error?

David Meador

David Meador

Updated on 15-Jun-2020 09:04:44

1K+ Views

To handle jQuery AJAX error. The ajaxError( callback ) method attaches a function to be executed whenever an AJAX request fails. This is an Ajax Event.Here is the description of all the parameters used by this method −callback − The function to execute. The XMLHttpRequest and settings used for that request ... Read More

What is the difference between jQuery(selector) and $(selector)?

David Meador

David Meador

Updated on 13-Jun-2020 12:29:05

262 Views

The $ variable is for jQuery.  If you’re using more than one JavaScript library or multiple versions of jQuery, then you should use jQuery(selector) instead of $(selector) to avoid name conflicts.ExampleTo understand the noConflict() concept, let us see an example of using the jQuery (selector):Live Demo ... Read More

Previous 1 ... 6 7 8 9 10 ... 17 Next
Advertisements