Please navigate to the bottom of the page for Table of Contents

Thursday, June 2, 2011

jQuery AJAX functions part 1–the load() method

jQuery is rapidly gaining popularity in many web applications and most of the modern frameworks (including ASP.NET) are providing official support for this lightweight and powerful framework. As such, most of the web developer and SDET interviews now make sure that the interviewee knows and understands the jQuery concepts. This includes (but is not limited to) selectors, getters, setters, events, effects, ajax, plugins and UI library concepts.

In the next few posts, we will discuss the jQuery AJAX functions. There are 3 categories of questions: Explain the basic jQuery load() method; Explain the jQuery utility functions; and lastly, the king of all functions: Explain the jQuery ajax() function. In this post we will focus our attention on the load() function.

Basic load() method

The simplest AJAX method in jQuery is the load() method; given a URL, it will asynchronously load its contents and display it dynamically on the page (in the element specified).  In it’s simplest form, the load function looks something like this:


A more complete example might be when you combine this functionality with a timer to update some element on a periodic basis.

// Load and display the current status every minute
setInterval(function() {
}, 60000);

The code above will get the entire contents of the specified web page. The load() function also allows you to get partial page content. The trick is to add a space to the URL and follow it with a jQuery selector. When the URL has loaded, the selector you specified will be used to select the portions of the loaded HTML to be displayed:

// Load the temperature section of the weather report
$('#db_status').load("CurrentStatus.html #DB");

The complete signature of the load() method takes in two additional optional parameters

.load( url, [ data ], [ complete(responseText, textStatus, XMLHttpRequest) ] )

url - A string containing the URL to which the request is sent.
data - A map or string that is sent to the server with the request.
complete(responseText, textStatus, XMLHttpRequest) - A callback function that is executed when the request completes.

Passing data to the load() method

If you pass in a string as the data, it is appended as a query string parameter. On the other hand, if you pass in an object, it is converted to name=value pairs. For example, the first call is passed as query string data and the second example shows an object that is passed to the call.

// Load the status for a particular server
$('#status').load("CurrentStatus.html", "server=db01");

// pass an object as data specifying an interval of day
{ server:'DB01', interval:'1day' });

Executing a callback function

The second optional parameter is a callback function that will execute on completion of the load() method.

$('#result').load('ajax/test.html', function() {
alert('Load was performed.');

One important fact to note is that the POST method is used if data is provided as an object; otherwise, GET is assumed.


  1. I really like what you have covered whole in your jquery series.

    1. Hello Nikhil,

      What a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this.
      I'd like to share with you a OOP design question I have related to a group of classes/objects I'm developing in Java.
      I'm writing a little program to generate Cards for the Italian family game of Tombola (a sort of Bingo) and then use these cards to support the game when there are many players (tens or hundreds).
      Cards are made up by 15 numbers chosen among the set [1.90] and displaced on three rows with five numbers each.
      I’d like to have a “Card” class which objects represent playing Tombola card.
      Then I’ve an algorithm that arrange all the 90 numbers (they are in an int [90] array) so that is generate six cards at one time (six cards with no number in common are called a “series of cards”). It will make sense to avoid client program could create just one single card with a statement like:
      Card card1 = new Card();
      My question is related to the “factory pattern” to use for instantiating new Card objects and the place where to put the generation algorithm introduced above.
      Ensure sufficient information (accuracy, completeness, precision, and classification of the information, where warranted) is provided or display.
      Currently I’ve just a couple of ideas.
      The first:
      I use a public static method on the Card class that returns an array containing six cards.
      Very useful article, if I run into challenges along the way, I will share them here.


  2. This is an excellent straight forward example and clearly presented explanation. Thank you.

  3. Once you know what you want to see, then you can figure out where you want to stay.
    Situs Poker Online International resorts and hotels are common around the island and are great places to stay when you want easy beach access.

    For cheaper and more authentically Cuban accommodations,
    DominoQQ you can choose from all sorts of hotels and guest houses. Whether you stay in the capital of Havana, or decide to stop in some of the smaller towns, there is always going to be somewhere you can rent a room. Known as "casa particulares", there are small guest houses where people offer rooms for rent in their own homes. It's a common feature in Cuba and a way to same some money because the costs are usually quite low.

    These are basically all the details you need before you plan your Cuba voyage.BandarQ Once you have a travel plan worked out, all that's left is getting things booked and head out.

    Terri has traveled the world and is always looking forward to her next adventure.Domino 99 She prefers to visit new and exciting places instead of the usual destinations.

  4. usually posts some incredibly exciting stuff like this. If youre new to this site :)
    That could be the finish of this report. Right here you will uncover some websites that we think youll value, just click the links.

    Agen Poker Online Indonesia Terbaik Terpercaya Terbesar 2017

  5. An impressive share! I’ve just forwarded this onto a co-worker who
    has been conducting a little homework on this. And he actually bought me dinner
    because I stumbled upon it for him… lol. So allow me to reword this….
    Thank YOU for the meal!! But yeah, thanks for spending some
    time to discuss this subject here on your web page. Parabola Tv Muslim ::: Parabola Tv Muslim ::: Parabola Tv Muslim

  6. growing muslim Entrepreneurship should be our motive. Who does wanna start business but are affraid of can take help from startup muslim. They have expertise and they also help people as well.

  7. The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    animal jam | five nights at freddy's | hotmail login


  8. Over time, in the sensual massage beautiful setting in Hawaii.
    Some of the best are a peacock feather or other light bird’s
    feather, silk scarf, wool muffler, cotton balls,
    cotton knit such as a soft tee shirt, dry natural sponge, marbles, tennis ball, leaves, flowers.
    Aromatherapy should also be of benefit for improving the function of the
    actual body organs.
    Jasa SEO Indonesia Murah Terbaik dan Profesional


  9. The share your really gives us excitement. Thanks for your sharing. If you feel tired at work or study try to participate in our games to bring the most exciting feeling. Thank you!
    hotmail sign in | red ball |

  10. Hi!How to callback ajax in jquery??

  11. a pride for me to be able to discuss on a quality website because I just learned to make an article on
    cara menggugurkan kandungan

  12. We find lots of learning after reading this very useful article . cara menggugurkan hamil

  13. You can connect your HP wireless printer to Wi-Fi to printer from distance with the help of wireless feature. If you are a new user and do not know about the HP Wireless Printer Setup then get help from experts to set it up easily.

  14. Aol desktop gold is very easy to use and it is all in one desktop. You can do multiple things on it. It provides the high-security feature to protect aol account from hackers. It automatically replaces your old version with the latest one. You don't have to do it. Download aol desktop gold from desktop gold

  15. Geek squad is the best service provider. They help you to manage your device. To install or manage your device you can use their geek squad chat support feature. They find the best possible solution within minutes. You don't have to wait a lot for that. For further queries, you can visit geek squad best buy

  16. It would not be wrong to state that Yahoo Support service is 24by7 ready to provide you feasible possible solutions to error code 400 at your disposal. Simply, by availing the above given troubleshooting service, one can have talk with customer care technicians and fetch the real time aid.

    Yahoo Help

    Yahoo Number

  17. Are you one of those Epson printer users who are running into paper jamming problems? Are you not aware of the right troubleshooting process to resolve such kind of problems? Simply, you should remove the stuck paper from your printer and also check the paper tray alignment. Even if the same problem still arises, you should opt for the quick Epson error code 0xf3 directly from the professional geeks. So, why are you waiting for?

  18. Hi, I am mason Lava. I am from The United State. I provide HP Laptop Support In worldwide. If you are an HP laptop user and your hp laptop touchpad not working.Get help from our Hp laptop experts. Our technician is available at any time anywhere

  19. Have you really lost your Facebook account password? Don’t you know how to get it back without having to face any kind of problems ad hurdles regarding the same? Just be relaxed! You should approach the professionals who are proficient in providing the Facebook Customer Service and get the same.

  20. Yahoo Customer Service: A Simple To Fix Technical Problem

    Do you want to do opt for the right kind of remedy and treatment to your problems pertaining to your Yahoo mail account? In such a case, you should take Yahoo Customer Service from a reliable source where you can have the quick problem solving solution, at the comfort of your home.

  21. Can’t Find The Solution? Yahoo Phone Number Helps A Lot

    Are you unable to get the best in class solution to your problems pertaining to your Yahoo mail account? You should avail the right direct from the professionals who would comfortably assist you to have the quick yet effective solution to your problems by using Yahoo Phone Number at anytime.

  22. To Cash Aap Transfer Failed Issues, Contact Cash Aap Customer Services
    If you have any issues while transfer money or bill through credit card, debit card or you are not able to access it anywhere on any device. So in that case, you can call our Cash App Customer Service at any time, they can resolve your issues easily. We are available anytime for any assistance.

  23. Top-Notch Technical Backing By Getting Yahoo Support Service
    If you have any kind of problems and hurdles, then you don’t need to approach all the customer support service providers. For the purpose of getting the right kind of customer care service, you should make use of Yahoo Support service and resolve your hitches and glitches in no time.

  24. Take Cash App Support if you need quick help for problematic Cash Aap?
    Are you looking for a quick and effective solution to tackle problematic cache apps voluntarily? In such a case, you should connect with the Cash App Support team through various channels such as live chat, email support and live chat service. Doing this will help you in the best possible way.

  25. Take Cash App Support if you need quick help for problematic Cash Aap?
    Are you looking for a quick and effective solution to tackle problematic cache apps voluntarily? In such a case, you should connect with the Cash App Support team through various channels such as live chat, email support and live chat service. Doing this will help you in the best possible way.

  26. Obtain Yahoo Customer Service If Yahoo Account Get Hacked
    If you have any kind of technical problems pertaining to your hacked Yahoo account, you should make use of the Yahoo Customer Service which allows you to have a proper direction about the same. You should also get the proper technical backing from the professionals who will surely help you out.

  27. Nice Post..
    24/7 help is available for HP solution center installation
    HP solution center is now known as a HP printer assistant. If you want to install it, you need to download it from HP support official website. It helps users to manage HP printer or scanner effectively. If you’re facing any technical issues with it, our technical support executives are much trained to apply the right technical instructions to install HP Solution Center in the right ways. Our techies are technically caring and capable, so they will finish this process within a few minutes. Our 24/7 help is open for you to get quick support or help.

  28. While printing any document, you are experiencing canon printer in error state. This warning message can prevent you to work on your printing device. If you’re experiencing this error again and again, you should look for quality technical assistance. If you want to fix this error, you can give us a single call and our trained technicians are available round the clock to know your issue and its reasons. Our technical support experts have good knowledge of handling such types of issues within a few seconds. Our helpline number is open 24/7 to provide the solid solutions for any issue.

  29. Quick Response From The Experts At Facebook Phone Number
    Are you having any kind of technical issues during the course of using Facebook? Do you also need the immediate

    help directly from the certified and adept technicians? For that, you should opt for the best way possible by just

    making use of the round the clock working Facebook Phone


  30. Eliminate Blocking Problems By Just Using Facebook Phone Number
    At Facebook Phone Number, you

    will be able to get the reliable support to resolving blocking problems. Here, you will get to know about the

    various things pertaining to blocking and unblocking of your Facebook account user. Besides, if you face any issues

    regarding the same, you need to get the right aid from the professionals.

  31. Expel Connections Errors At Once Through HP Support Assistant
    By moving toward HP Support Assistant, you will

    have the option to arrangement your printer to your PC or PC utilizing USB or remotely. You can have a word with

    these experts and request the assistance in regards to the associations and goals to such sort of issues in regards

    to the equivalent.

  32. How Do I Get My Cash App Refund Back Without Any Mishaps?
    Do you not have money application account? On the off chance that indeed, you frequently utilize it to take into

    account different needs. If there should arise an occurrence of installment disappointment and you critically need

    Cash App Refund, you can get the correct sort

    of direction legitimately from the guaranteed experts at whenever from anyplace.

  33. Get To Know About The Process To Get Facebook Forgot Password Recovered
    If you want to be aware of the process to get your Facebook Forgot Password recovered in a couple of seconds, you should make use of the

    troubleshooting professionals who are capable of directing the real time process in a step by step manner. So, why

    don’t you avail the right kind of help from the experts?

  34. Get Facebook Forgot Password Back Using Alternative Mobile Number
    Facebook gives you the constant office to sort your secret phrase related issues and furthermore causes you to

    recoup Facebook Forgot Password with

    the guide of auxiliary email address. It causes you to check your character and furthermore encourages you to make

    new secret phrase for your Facebook account.

  35. Is Hp Solution Center Capable Of Fixing Driver Update Problems?

    Yes, Hp Solution Center is capable of fixing the whole host of driver update and installation related problems at anytime from anywhere. In addition to this, you can also fetch the real time guidance and supervision regarding the performance of your printer with Hp Support.


  36. How Do I Download Printer Drivers Easily With Epson Support Professionals?

    • Are you one of those who want to download Epson printer drivers?
    • Are you not aware of the process to get it downloaded from the genuine sources?
    For that, you should first of all avail Epson Support directly from the professionals who will surely help you out in a couple of seconds.

  37. Set Up A Secured Password By Joining Yahoo Support Service

    Are you not aware of measures which would allow you to setup the secured password pertaining to your Yahoo mail account? Don’t need to worry! All you need is to make use of Yahoo Support Service and get the right kind of solution to your problems and hurdles in a couple of seconds.
    Read More:-


  38. Guidelines For Lost Password Recovery At How to fix yahoo account hacked issue

    Whenever you face any kind of problems regarding the lost password, you should make use of the correct and authentic troubleshooting guidance using the how to fix yahoo account hacked issue. It is absolutely free of cost troubleshooting aid provider which aids you round the clock. So, you will be able to get your password back in no time.Read More:-

  39. How To Delete Old Emails On Gmail Using Gmail Number?

    If you can delete your older emails from your Google mail account, you should get to know the proper process to do so. Simply making proper use of Gmail Number and you will be able to have a word with the techies who will provide you with the right kind of solution to your problems comfortably.
    Read More:-


  40. Gmail Customer Service: A Problematic Login Problem Solution
    Are you facing problems with the login into your Gmail account? Are you completely unable to get the right solution to your login problems? In such a case, you should make use of the right kind of guidance regarding the Gmail login. Simply, use Gmail Customer Service and get the aid quickly.

  41. Approach HP Solution Center For Fixing Network Problems

    Yes, you are not only allowed to approach HP Solution Center but also fetch the instant technical backing directly from the professionals. If you want to avail the quickest remedy along with the supervision regarding the problems and hurdles, pertaining to HP printer network, you should get the free assistance at anytime.

  42. Sort Paper Jamming Problems Using HP Printer support Anytime

    HP printer provides you the facility to fax, scan and print any kind of documents and images. In order to sort out paper jamming problems, you should make use of HP Printer Supportso that you can easily have a word with the right kind of technical backing and supervision directly from the professionals at anytime.

  43. Want To Add Extra Security Of Your Gmail Account? Use Gmail Phone Number
    If you really want to add an extra layer of security over your Google mail account, you should quickly opt for the right guidance from the experts. Here, they will suggest you to enable different safety features and functions. For that, you should approach them using Gmail Phone Number

  44. Take Assignment Help if you have any issue for composing your academic papers. If you connect with trustworthy service provider, browse various web pages of greatassignmenthelp for more information.
    Assignment Help Online
    Online Assignment Help
    Assignment Help Online Services
    Assignment Helper
    Assignment Assistance
    Assignment Help Experts
    Online Assignment Help Services

  45. Being a student of USA, if you find tough to write your assignments, then select our Assignment Help USA services. With us, you will not get any issue in writing and content quality.
    Assignment Help Online
    Best Assignment Help
    Assignment Helper
    Assignment Help In USA
    Online Assignment Help
    Assignment Help Experts
    Online Assignment Help Services

  46. How Can Novice Users Opt For Hp Assistant For Instant Guidance Of Experts?
    In order to opt for Hp Assistant, users are required to get in touch with the experts using different mediums such as live chat and email support service. With troubleshooting professionals, you can get share your problems and get the real time backing even in the odd hours.

  47. Get Brother Support Service If Having Issues While Updating Drivers
    Are you not able to update the drivers of your Brother printer? For the same purpose, you should make use of the Brother Support t service. Here, you will get a chance to get in touch with the best in class technicians who are skilled and adept in providing you with the help regarding the same, with the ease.

  48. You can use both online and desktop version of this software. If you face QuickBooks Error H505 then immediately contact certified experts to fix it. A team of certified experts is present round the clock to help customers regarding QuickBooks’s issues.

  49. Thanks for your valuable post. Please post some more related topics. We are on your page only to read your blog because, as you know, there are no other for being here. Like you, we also here for some information of Outlook, so if any of you need any type of help related Outlook then contact our Outlook support phone number or visit the website.
    How do I contact outlook by phone?
    How do I contact Outlook support?
    Is there a phone number for Outlook support?
    Outlook Support Phone number
    Microsoft Outlook Support

  50. Reset Amazon Password With The Help Of Expert Services

    Do you want to reset your Amazon password on kindle? The Amazon professionals will guide you through the entire procedure of Reset Amazon Password in few minutes. Apart from password solutions they also provide assistance related to Amazon Account set up and various other issues that come in your way of accessing Amazon. Reach out to them at the comfort of sitting at home or office.

  51. How to Know The Process To Get My Cash App Refund

    To start with the procedure, you should log into your Cash App account from your mobile or computer. Now, see the clock icon given on the home screen and hit on it. Then, tap on the payment option. Find the Cash App Refund option. To finalize the refund, hit on the 'OK' button.


  52. Opt For Suitable Solution to Frontier Email Login Problems
    You might find a lot of technical ways to resolve Frontier Email Login related problems and hurdles. As you can get in touch with the best customer care technicians, you can have the right solution at anytime from anywhere. These services are available 24x7 so that you can get the one stop solution to your problems in no time.

  53. Reset Amazon Password? Instantly Recover It with Support Services
    Forgot Amazon Password? People today have multiple accounts with different websites and a lot of. In such cases, they tend to forget passwords to their account every now and then. Don’t worry if you fail to remember your Amazon Prime account password. You can simply recover your account, reset and change your account’s password with Reset Amazon Password support services at your disposal.


  54. Get The Password Back With Facebook Account Recovery Assistance

    Sometimes, it happens when you forgot your Facebook account password and you lost the access to your Facebook account. To get it back in a trouble free manner, you should completely follow the Facebook Account Recovery steps in a careful manner. Besides, if any kind of technical assistance is needed, you should approach the experts.

  55. Support for Frontier Email Login Error Issues

    Are you facing Frontier email login error issues in your account? Is your account password getting changed automatically? Is your account getting logged in from different locations? Then it is advised to contact Frontier Email Login support as soon as possible to secure your account from any malicious intent and secure it from any kind of trouble or getting.


  56. How To Perform Facebook Account Recovery Operation Flawlessly?

    Have you accidentally lost your Facebook account password? Are you one of those Facebook users who want to get your lost account password recovered with the optimum ease? You should perform the Facebook Account Recovery operation under the guidance of the experts and get your password recovered successfully in no time.

  57. It is rare that user face issues with HP laptop but some users have query regarding the HP laptop. You can contact HP Laptops Support to get help from experts to resolve your query regarding HP laptop.

  58. If you are experiencing QuickBooks Error 15241 on a regular basis, I and my QuickBooks support professionals are technically known for resolving QuickBooks error 15241 efficiently.

  59. This post is really good which inspires you how to cultivate your knowledge stream. For pouring the relative style in your upcoming post, you can use microsoft office 365 download link to execute the file without any hindrance. Visit here:-
    office 365 download
    Download Office 365
    Microsoft office 365 download
    download Microsoft office 365

  60. The mentioned points in this guide are very informative and helped me to resolve my issue in a very proficient manner. At the time of solving my query I got stuck at one point, so I called at outlook Support Phone number and the technician who answered my call guided me thoroughly to get rid of my issue. I really appreciate the hardworking of that guy, who helped me during my crisis of time and never leave my side until problem didn’t get resolved. Therefore, I personally suggest everyone to get hold of Microsoft outlook Support if you really want to resolve your query related to your Outlook.
    How do I call Outlook support?
    Is there a phone number for Outlook support?
    Change Hotmail Password
    hotmail change password
    change microsoft password
    Windows support
    Microsoft windows support

    Office 365 Support
    Microsoft Office 365 Support
    Microsoft 365 Support
    Office 365
    Microsoft Office 365

  61. This comment has been removed by the author.

  62. To fix account hack issue, just join Facebook Support from experts

    Your facebook account represents you, and it should be only accessible from you. If anytime you think that your account is hacked or some other person has taken it over, then you need to secure your account on an immediate basis. Your account may be hacked when you find your credentials are changes, your name or birth dates are changed, friend request sent to some unknown people, or something unusual happens without your consent. To overcome such inconveniences, we suggest you join our Facebook support.


  63. Dial Facebook Number to know how to make a strong password

    To protect your facebook account from third party attacks, it is mandatory to maintain strong login credentials. While creating password, make sure your password is difficult for others to crack, and different than passwords of other accounts. To learn more about Facebook security, or privacy settings, you get in touch with our experts dialing toll-free Facebook number

  64. If you are troubling hardly with QuickBooks Error 15106, I and my QuickBooks team have extensive knowledge of fixing this error code proficiently. Our QuickBooks professionals will provide you hassle-free support for any kind of troubles.

  65. If you know exactly how to <a href="'>Change amazon password</a>, it may take very little time for you to do so. But, if you have a doubt, it may take a longer time, and also doing anything wrong may take you to some really serious issues. So, if such is the case, then, it’s better for you to ask the customer support to help you.

  66. If You Wish to install HP Solution Center you can easily download it from the HP Support Site, or through the HP Printer Install Wizard for Windows. The HP Printer for Windows scans your system for devices, software and drivers and then installs the appropriate software on your PC, such as HP Printer Assistant or HP Solution Center.

  67. Have you forgotten your Netflix password? If yes, then do not worry as you can easily Reset Netflix password in a few simple steps. There are three ways to reset the password; one is by using your registered email address, second is by receiving an SMS on your mobile number and the last one is by using the billing information. All you have to do is visit the login help page of Netflix and choose the option for resetting password followed by some on-screen prompts to complete the resetting process.

  68. If one is using an HP Laptop with a touch screen then sometimes people wants to turn off the touch screen of their laptop to work properly on it. If you want to know more about how to turn off the touch screen on HP laptop.

  69. Thanks for sharing this post , Hello , my name is baroncorrz , we are working with "Epson support team for long time .If you face any types of Error in your epson printer you can easily contact us, we are rectify your default as soon as possible. We are reliable in tech support; if you face Epson printer in error state, contact our technician at any time.

  70. Thanks for sharing this post, We are the most recognized independent and trustworthy third-party technical support company, delivering top quality support and specialized assistance for brother printer users. If you are facing Brother printer in error state, our printer technicians have the best technical skills and extensive experience for solving this error immediately. Our printer technicians are technically known for resolving this technical error within a few minutes.

  71. If you are getting technical issues with your PC/laptop, printer, scanner and other device then don’t surprise. Technical issues are common to any digital electronic device. If you are an HP device user and having technical issues then contact hp/support to get immediate help from experts.

  72. My Assignment Help is the most preferred place to get assignment help in Australia where we offer 100% plagiarism free and money back guarantee ensuring complete satisfaction of students with every order. Our professional in-house writers provide my assignment help services online so that you can connect with us anytime and assign your work for a timely delivery of quality assignments.

  73. Want to know about how to uninstall apps on Mac? You just have to drag a file to the trash and it will delete that program from your machine. It will leave the preference files behind, though, which can be a good thing.

  74. Our online professionals provide help with assignments, reports, thesis, essay and more other forms of assignment to students. They lowers students stress by providing help within the prescribed time.
    Abc Assignment Help is connected to best professionals for helping them write quality assignment with proper referencing, citations and format.
    To know more about physics assignment help, students can connect with online members of abc assignment help.

  75. Getting 100% success of your business by getting top rank and generating huge traffic is easy with our best SEO services company. By applying needed efforts and time along with the right strategies, our experts assure your online business success.