In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "load () method in JQuery how to achieve Ajax function", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "JQuery in the load () method how to achieve Ajax function" this article.
I wrote about using XMLHttpRequest objects to load data asynchronously in traditional Javascript, alas, children's shoes. Isn't it a bit of a headache to see those codes? Hehe. Not only you, I am a little disgusted, not only to judge the browser, but also. Anyway, there is a big pile of code, which doesn't look good. Now, let's forget to take a big pile (remember: it's not really forgotten here! It seems that when many companies interview Ajax, they will let you write an original Ajax program without dragging controls, so its importance, you know! ! Well, having said so much, you should "forget" you! Hehe. The time has come to witness miracles. Don't say I'm bragging! This is not what I said, this is what Liu Qian said, what can I do for him? ! In JQuery, you can easily get asynchronous loading data by using the load () method, so let's replace this chunk of code with a few lines of code. (first of all, just like before, create two new pages, 1.htm and 2.htm! )
The code in 1.htm is as follows:
/ / Note: don't forget to add this!
$(function () {)
$("# btnGet") .click (function () {/ / button click event
$("# divMsg"). Load ("2.htm"); / / call the load () method; load syntax format: load (url, [data], [callback]): where url is the address of the loaded page; optional parameter data is the data to be sent to the server / server in the format of a callback function returned to the loaded page after key/value;callback is loaded successfully
})
}) / / you must pay attention here! Parentheses must be typed "in pairs". When you write a lot of code, you will make a mistake at this point.
The code in 2.htm is as follows:
Name: side dish
Gender: male
Mailbox: cj1161059871@163.com
The above is all the content of the article "how the load () method in JQuery implements the function of Ajax". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.