What Is Ajax? Is it a method that is not easy to grasp, but can increase website interaction? Is it the cornerstone of Web2.0? Or is there another trend in network development? Just like the Flash font and Splash pages that have been popular before,
Here, we assume that the reader understands the basicAjaxTechnology or more. I will only elaborate on one phenomenon, one solution; reason,The principle is also unclear.......Let's start with a simple process,Upload servlet values to JSP page jsIn
Introduction:Ajax asynchronous transmission can transmit strings, but data such as arrays is not very easy to transmit. What should we do at this time?
The answer is that the data can be processed in json format, and the data is encoded in json
1: ajax constructs a url by itself. In this way, passing parameters must use Data and cannot be used for form submission.Example:Copy codeThe Code is as follows:Function createHtml (id ){$ ("# Reloading"). show ();// Edit_bg is a div that is
The js cookie operation method mainly involves setting, reading, expiration, and deleting cookie values. The following section summarizes some common js cookie operation application instances, I hope it will help you both in depth.
Today, we will
We need to use regular expressions to obtain addresses like img or href. Next I will introduce you to the process of getting URLs in img using js. I hope this will be helpful to you.
The solution is as follows:
The Code is as follows:
A js checks whether the image fails to be loaded and whether the URL is valid. I hope this will be helpful to all of you.
For a good user experience, if the address of an image on the webpage is invalid, a default image with an invalid image will be
Use location. reload () or location. href to refresh the current page in js. Of course, we can use window. parent. frames to refresh the framework page. Let's take a look.
Reload MethodThis method forces the browser to refresh the current
An anonymous function is a function without a name and can be automatically executed. For example, a function () {}) () is a function. Let's take a look at some usage of an anonymous function.
Looking at the js files of many websites, the first
Now many webmasters want others to copy their own website articles to bring a link, but this is just an idealized process where almost everyone will delete the source, the copyright information is automatically added to the end of the article. Below
Js to obtain the flash height, we can add an ID to the flash embed object, then get the object through getElementById, and then set the height and width.
JS:
You can set the height and width of the embed to change the flash height and width.
Js is used in the project. jquery is the first choice, and libraries can be used.
If you encounter a repeated submission problem, disable it. Baidu google, or Google.
Zhihu has an expert who summarized four methods. It is better to use the Jquery.
① Load ()
$. Load (url, data, callback)
The url of the page to be loaded,
Data key/value format sent to the server,
Callback indicates the callback function that is returned to the page after loading successfully.
The url can also filter page
I. XMLHttpRequest
The Code is as follows:" method = "post">
Ii. jquery ajax. post
1. jQuery $. post () method
The $. post () method sends an http post request to request data from the server.
Instance
The Code is as follows:$ ("Button"). click
We found that jquery ajax is used today. when submitting the post data, we will find that the data in ff is normal. However, in chrome and IE browsers, all the previous post data is garbled, and most of the garbled characters are Encoding Problems,
This article introduces an example of using the Floatbox plug-in Javascript in ajax callback. For more information, see.
The Code is as follows:
Copy code
We will see a lot of websites have a comment or news, there will be a top or step-on function below, so we just need to click it to implement, next I will introduce how to use php + mysql + jquery ajax to implement this function.
We must first
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