Ajax and JavaScript Authentication User Login
index.html
User login & lt;/tr> User name: Password:
Login.js
var btn = document.getElementById (' btn ');
var re = document.getElementById (' re ');
var user =
If the transfer parameter is directly assigned, it will produce garbled!Http_request.open ("POST", url,true);Http_request.setrequestheader (' Content-type ', ' application/x-www-form-urlencoded ');Http_request.send ("action=" +strname+ "&val=" +val);
Recently in a project, is to write while learning some things. Put the frame of the struts2+spring2+hibernate3 to run through, encountered to do user name verification, think of using Ajax to do. Used to write their own handwriting, this time to try
One, JavaScript cross-domain access
1. Set the Document.domain value of the access page and the page being visited.
2, use the IFRAME to connect two domains of the page.
II. Ajax cross-domain access
1, using the script tag to achieve
The
First to share the resources found at that time (10 jquery Ajax File Upload Plug-ins, some plug-ins business will charge, pay attention to copyright): http://superdit.com/2010/06/29/10-jquery-ajax-file-uploader-plugins/
At that time their own needs
First download the Ext-basex script file from http://code.google.com/p/ext-basex/, after decompression, according to the instructions Readme file to refer to the EXT library and Ext-basex.
Then use the Ext.Ajax.request method to add
Always enjoy using native JavaScript, especially if you don't need to consider compatibility scenarios (albeit pitifully). Unfortunately ECMAScript does not encapsulate a good Ajax method (in fact, there is no need to have), the use of their own
encapsulating Ajax and Promise
First, Ajax
Ajax is called "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML) refers to the development of interactive Web applications to create a technology, improve the user experience, achieve no
The main is to see an online blog http://blog.csdn.net/fdemon/article/details/6358520#quote, according to this blog does not achieve the correct results. The amendment is as follows:
1. Create an HTML Web page file. FileName: test.html
jquery is a fast, concise JavaScript framework. The purpose of jquery design is "write Less,do more", which advocates writing less code and doing more things. It encapsulates
JavaScript's common feature Code provides a simple JavaScript design
One notable issue in the post using jquery is that when using $.ajax,
Be sure to note that Ie,chrome and Firefox are a bit different, such as
Java code $.ajax ({type: "POST", url: "frontworkflow/frontworkfl Ow!redirecttaskform ", Data:" taskid=
$.ajax ({Type: "Post",Url:url,DataType: ' HTML ',Success:function (data) {},Complete:function (XMLHttpRequest, Textstatus) {},Error:function () {}});
success: The function that is called when the request succeeds. This function will get a parameter:
When using Ajax to perform an asynchronous refresh of a part of a page, after grabbing the packet, you can find that the problem is that if the contents of the form are unchanged, it does not make a request to the server, but instead caches the
Most of the time when uploading files, they are submitted using a form. There are several ways to upload a file using the form form:
1, the interface directly using the Submit button submitted. This way you can achieve the effect but there is no
1. Setting Up Xmlhttprequest/msxml2.xmlhttp objects
This should be the most common way, very easy to use, can really connect XML objects,
Can be submitted by "POST" "GET",
However, cross-domain is not supported in Firefox
2. Use DOMDocument object,
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.