Use jquery local refresh (jquery. load) to retrieve data from the database _ jquery
Source: Internet
Author: User
Jquery provides good ajax interaction. Here I use a string that is returned directly, and jquery is used. the load method extracts data from the database because Jquery is a good javascript framework, and my use of it is still superficial, in a preliminary learning stage, therefore, if you record my learning experience through a blog, you can skip this article. I hope this article will help beginners like me to share and make progress together.
Currently, ajax is increasingly favored by web developers. jquery provides good ajax interaction. Here I use a string that is returned directly, and the jquery. load method is used, which is very basic. Project download
Pay attention to the following two points:
1. The jquery. js path should be correct, otherwise it will be difficult to achieve the desired effect.
2. You need to use $ (document ). ready, this method means that after the file is loaded, execute the JS script in it. If you do not add it, it may not be completed in your document organization, the event binding statement has been executed, but your "# load" has not been loaded yet, leading to event binding failure.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service