Found 10711 Articles for Web Development

What is the difference between jQuery and AngularJS?

David Meador
Updated on 12-Dec-2019 08:23:17

214 Views

AngularJS is an open source web application framework. It was originally developed in 2009 by Misko Hevery and Adam Abrons. It is now maintained by Google. Its latest version is 1.4.3.The following are the features of AngularJS:AngularJS is a powerful JavaScript based development framework to create RICH Internet Application(RIA).AngularJS provides developers options to write client side application (using JavaScript) in a clean MVC(Model View Controller) way.Application written in AngularJS is cross-browser compliant. AngularJS automatically handles JavaScript code suitable for each browser.AngularJS is open source, completely free, and used by thousands of developers around the world. It is licensed under the ... Read More

What is the difference between Ajax and jQuery-Ajax methods in jQuery?

David Meador
Updated on 12-Dec-2019 08:25:12

1K+ Views

Firstly, let’s go through what is Ajax and why it is used.AJAXAJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script.It has the following points, which shows its importance.AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script.Ajax uses XHTML for content, CSS for presentation, along with Document Object Model and JavaScript for dynamic content display.With AJAX, when ... Read More

What is the difference between jQuery.size() and jQuery.length?

David Meador
Updated on 12-Dec-2019 08:29:42

329 Views

jQuery.size() methodThis method returns the number of elements in the object. The size() method deprecated in jQuery 1.8 and completely removed in jQuery 3.0. As an alternative, the length property is used.ExampleYou can try to run the following code to learn how to work with size() method.Note: To run the jQuery size() method, use jQuery version less than 1.8, since it deprecated in jQuery 1.8. Generally, the length property is preferred now.Live Demo $(document).ready(function(){     $(".btn").click(function(){         alert($("li").size());     }); }); How many li elements? ... Read More

How to add display:none in an HTML element using jQuery?

David Meador
Updated on 17-Feb-2020 10:05:49

3K+ Views

To workaround with display: none in an element in jQuery, use the hide() method. It will do the same work.ExampleYou can try to run the following code to learn how to add display:none in an HTML element −Live Demo $(document).ready(function(){   $("button").click(function(){     $("p").removeAttr("style").hide();   }); }); Heading 1 This is demo text. This will hide on button click. This is another text. This will hide on button click Hide

How to toggle a div visibility using jQuery?

David Meador
Updated on 17-Feb-2020 10:04:26

7K+ Views

To toggle a div visibility in jQuery, use the toggle() method. It checks the div element for visibility i.e. the show() method if div is hidden. And hide() id the div element is visible. This eventually creates a toggle effect.The toggle( speed, [callback]) method toggles displaying each of the set of matched elements using a graceful animation and firing an optional callback after completion.Here is the description of all the parameters used by this method −speed − A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).callback − ... Read More

What are the options for jQuery Animated Effects?

David Meador
Updated on 12-Dec-2019 07:53:30

105 Views

jQuery animated effected can be achieved with methods such as animate, slideDown(), slideToggle(), etc. This created an animation effect in an HTML web page using jQuery. The following table lists down some of the important methods to create different kind of effects:S. NoMethods & Description1.animate( params, [duration, easing, callback] )A function for making custom animations.2.fadeIn( speed, [callback] )Fade in all matched elements by adjusting their opacity and firing an optional callback after completion.3.fadeOut( speed, [callback] )Fade out all matched elements by adjusting their opacity to 0, then setting display to "none" and firing an optional callback after completion.4.fadeTo( speed, opacity, ... Read More

How can I show and hide div on mouse click using jQuery?

David Meador
Updated on 15-Jun-2020 11:02:16

18K+ Views

To show and hide div on mouse click using jQuery, use the toggle() method. On mouse click, the div is visible and on again clicking the div, it hides.ExampleLive Demo $(document).ready(function(){     $('#show').click(function() {       $('.menu').toggle("slide");     }); }); Click to Show/ Hide div             India       US       UK       Australia      

How can I show and hide an HTML element using jQuery?

David Meador
Updated on 15-Jun-2020 10:57:41

1K+ Views

To hide and show an HTML element using jQuery, use the hide and show() methods. Here, the element is hidden and shown on button click,ExampleLive Demo $(document).ready(function(){     $("#visible").click(function(){         $("p").show();     });      $("#hidden").click(function(){         $("p").hide();     }); }); This text  will show on clicking "Show element" button, and hide on clicking "Hide element" button. Hide element Show element

What is the difference between error () and ajaxError() events in jQuery?

David Meador
Updated on 17-Feb-2020 09:56:32

187 Views

jQuery error() methodThe error() method triggers the event when an element encounters an error. This method deprecated in jQuery 1.8.ExampleYou can try to run the following code to learn how to work with error() method in jQuery −Live Demo $(document).ready(function(){     $("img").error(function(){         $("img").replaceWith("Image isn't loading");     });     $("button").click(function(){         $("img").error();     }); }); Error event jQuery ajaxError() methodThe ajaxError( callback ) method attaches a function to be executed whenever an AJAX request fails. This is an ... Read More

How to include multiple js files using jQuery $.getScript() method?

David Meador
Updated on 17-Feb-2020 09:54:08

533 Views

To use multiple js files, use the same getScript(), which is used to add a single js file. We’re having result.js file with the following code snippet −function CheckJS(){    alert("This is JavaScript - File1"); }We’re having result2.js file with the following code snippet −function CheckJS(){    alert("This is JavaScript – File2"); }ExampleHere's the code snippet to add multiple js files. Here, we will call the function in the above 2 js files −                                 $(document).ready(function() {             ... Read More

Advertisements