Today you need to use the Ajax get method, encapsulated into its own custom function name, inside but found a problem, always will be the custom of the method inside the whole execution of the code to execute the GET, which led to a different step,
Jquery.validate is a powerful form verification plug-in, of course, also perfect support for Ajax validation, so that it can be convenient, fast to check the user name, etc. exist.
Html/js Source section:
User name:
The use of the Ajax Post XML method
function PostData (url,posteddata){var xmlhttprequest= createxmlhttprequest ();Call the encodeURI method two timesPosteddata = encodeURI (Posteddata);Posteddata = encodeURI (Posteddata);var url = URL;Sending a
The HTML code is as follows:
The code is as follows
Copy Code
Document Trigger ajax The PHP code is as follows:Print_r ($_get);$data = Array (' Name ' => ' AAA ',' title ' => ' I-i-i ');$arr =json_encode ($data);File_put_
HTML code
The code is as follows
Copy Code
ajaxpjaxpanel departmentSomchit ManageriPanelonline
jquery Code
The
code is as follows
copy code
PHP Processing Code
Today in the project, the use of Kindeditor, the project's form is to use AJAX to submit data, and the previous version of the treatment of conflict, the Cup!
Before this use a relatively stupid method to solve the problem, when it is mainly not
Jquery.post (URL, [data], [Success (data, Textstatus, XMLHttpRequest)], [datatype])Returns:xmlhttprequest
URL A string that contains the URL to which the request is sent
Data map or string, send request to server
Success (data, Textstatus,
. Ajaxsuccess (Handler (event, XMLHttpRequest, Ajaxoptions))Returns
jquery Description:
Ajaxsuccess (Handler (event, XMLHttpRequest, Ajaxoptions))
Handler (event, XMLHttpRequest, ajaxoptions) The function to be invoked.Whenever an AJAX request
Use XMLHTTP Ajax to automatically save information complete JS code Function Createhttphandler () { var HttpHandler = false; @if (@_jscript_version >= 5) //JScript gives us conditional compilation, we can cope with old IE Versions. The
ASP. File
Dim conn,rsDim connstrDim sqlcmdDim username
' Get user Name query stringUsername=request.querystring ("username")
' Create a Database Tutorial connection object and openSet Conn=server.createobject ("Adodb.connection")Connstr=
In the wordpress root directory, create ajax. php as follows:Define ('Doing _ AJAX ', true );Require_once ('WP-config. Php ');Do_action ('WP _ ajax_nopriv _ '. $ _ REQUEST ['action']);Die ('0 ');Add the following code to functions. php in the topic
Example 1: log on directly using $. ajax The code is as follows:Copy code $. Ajax ({// Submit the addressUrl :"",// Submitted dataData: {key1: value1, key2: value2, key3: value3, key4: value4 },// Events before submissionBeforeSend: function
There are many reasons for ajax Chinese garbled text. How can this garbled text problem be solved?It's easy to use the built-in function encodeURIComponent of JS to escape Chinese strings. Usage of the encodeURIComponent function,Scape () method:The
Step 1: introduce necessary css and js on the page (the download address is provided at the end of this article for learning and use ): The code is as follows:Copy code Step 2: write html code, an upload button, and a preview Step 3: bind an
Solution:1. Add a random number to the request link. If jQuery is used, set $. ajaxSetup ({cache: false}) directly });2. Change type to post, and set a parameter data: 'A = B 'at will (you must set the parameter; otherwise, it will still be cached)3.
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.