Ricky Barnes has Published 121 Articles

How can I select an element by its ID attribute using jQuery?

Ricky Barnes

Ricky Barnes

Updated on 12-Jun-2020 12:46:54

311 Views

The element ID selector selects a single element with the given id attributes. Here’s how you can select:$('#elementid')You can try to run the following code to learn how to select an element by its ID attribute using jQuery:Live Demo           jQuery Selector       ... Read More

Where do we use jQuery.noConflict() method?

Ricky Barnes

Ricky Barnes

Updated on 12-Jun-2020 09:01:23

115 Views

jQuery.conflict() method allows you to use multiple frameworks, while using jQuery. The $ sign is used for jQuery, but what if other frameworks also use the same $ sign; this may create issues and conflict. To avoid this, jQuery issued the noConflict() method. The method releases the $ sign to ... Read More

How to write a custom jQuery plugin?

Ricky Barnes

Ricky Barnes

Updated on 12-Jun-2020 09:00:13

160 Views

To create a jQuery plugin, first create a file named jquery-demoplugin.js with the following code. This is our plugin code. Here, demoplugin is the name of our plugin. You can add any name to your custom plugin −(function ( $ ) {    $.fn.demoplugin = function( options ) {     ... Read More

What is the difference between jQuery.load() and jQuery.ajax() methods in jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:23:14

249 Views

jQuery ajax() methodThe jQuery.ajax( options ) method loads a remote page using an HTTP request. $.ajax() returns the XMLHttpRequest that it creates. In most cases you won't need that object to manipulate directly, but it is available if you need to abort the request manually.Here is the description of all ... Read More

What is the difference between jQuery.load() and jQuery.get() methods in jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:17:43

351 Views

jQuery load() methodThe load( url, data, callback ) method loads data from the server and places the returned HTML into the matched element.Here is the description of all the parameters used by this method −url − A string containing the URL to which the request is sent.data − This optional parameter represents ... Read More

What is the difference between jQuery.post() and jQuery.get() methods in jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:13:59

123 Views

jQuery post() methodThe jQuery.post( url, [data], [callback], [type] ) method loads a page from the server using a POST HTTP request.Assuming we have following PHP content in result.php file, ExampleThe following is the code snippet showing the usage of this method −                ... Read More

What does jQuery.serialize() method do in jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:07:40

99 Views

The serialize() method serializes a set of input elements into a string of data. Let’s say we have the following PHP content in serialize.php file −ExampleThe following is the code snippet showing the usage of this method −                        ... Read More

How to put a complete HTML page in a div using jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:06:12

468 Views

To put complete HTML page in a div using jQuery, use the load() method. Firstly, add the web page you want to add.Here’s the code for new.html −     Heading 1 Demo text ExampleNow, the code for the HTML file which adds the above page, ... Read More

How to use jQuery.getJSON to load JSON file in jQuery?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:04:28

748 Views

The jQuery.getJSON( url, [data], [callback] ) method loads JSON data from the server using a GET HTTP request.Assuming we have the following JSON content in result.json file −{ "name": "Amy", "age" : "24", "sex": "female" }ExampleThe following is the code snippet showing the usage of this method −      ... Read More

How to use jQuery.getScript() method to load external js files?

Ricky Barnes

Ricky Barnes

Updated on 17-Feb-2020 07:03:25

2K+ Views

The jQuery.getScript( url, [callback] ) method loads and executes a JavaScript file using an HTTP GET request.Here is the description of all the parameters used by this method −url − A string containing the URL to which the request is sentcallback − This optional parameter represents a function to be executed whenever ... Read More

Previous 1 ... 7 8 9 10 11 ... 13 Next
Advertisements