Tags that contain the target attribute include: <A> <form> <base> <area>.
The corresponding target values include:
_ Blank
_ Parent
_ Self
_ Top
Framename (the <area> tag does not exist)
For the above four, I am not familiar with it anymore. But few people noticed or used the fifth value: framename. Because it is designed so cleverly...
Here is an example of an asynchronous Ajax login method.
However, most logons cannot be performed using Ajax for the simple reason: Cross-origin and insecure. However, many requirements require asynchronous implementation without refresh. The following is the answer.
A form, corresponding to the target:
<Form action = "http://reg.domain.com/login" method = "Post" target = "hidden_iframe"> <input type = "text" name = "user"/> <input type = "password" Name = "password"/> <button type = "Submit"> logon </button> </form>
An iframe, corresponding name
<iframe style="display:none" frameborder="0" scrolling="no" name="hidden_iframe"></iframe>
In this way, when you click log on, the form will be submitted in the IFRAME below without refreshing the page.
Then, the system checks whether a user logs on through cookies. The following is a JS example:
/** Cyclically determine whether the user has logged on. Set the timeout time for 3 seconds. If the user name or password is not displayed within 3 seconds * @ callback: <function> callback function, determine whether the user logs on and executes */function dologin (callback) {var COUNT = 0, Timer = setinterval (function () {If (islogined () {clearinterval (timer ); callback & callback (); return;} // 3 s enouglif (++ count> 15) {alert ('user name or Password error! '); Clearinterval (timer) ;}}, 200) ;}/ * determine by Cookie */function islogined () {If (...) {.. the processing of a large push cookie is omitted here .. return true;} return false ;}