, JS a lot of can not understand, little brother I only learned PHP also a bit of HTML CSS knowledge

Source: Internet
Author: User
Help, JS a lot of can not understand, I only learned PHP also a bit of HTML CSS knowledge.
This post was last edited by wkhegx on 2014-07-23 14:23:42


function form (ID, Controller, Action, msg) {
$ (ID). Submit (
function () {
$ (msg). Load (
' index.php?controller= ' + controller + ' &action= ' + action
+ ' &inajax=1 ', $ (ID). Serializearray ());//What does this write here mean?
return false;
});
}



What is the meaning of this sentence?


The following code is not fully understood



Please greatly help me to see, my project code, do not understand Ah, these code is the core of this project. Please help me to explain, by the way recommend some good books to me, otherwise I have encountered this kind of things do not understand.
------Solution--------------------
The form function is to serialize the Id=xx form element and submit it to your controller, as with the submit effect.
The second segment of the function means to empty the value of the name=message element.
------Solution--------------------
These are JQuery codes, so you can learn a little bit

First paragraph
$ (ID). Serializearray ()
To construct an array of all the available controls for a form with ID ID
As the second parameter of the Load method, it is passed as a post parameter

Second paragraph
Assigning a Name=message control to an empty string

Third paragraph
Set up some event bindings

------Solution--------------------
First: The form of the submission ID, the commit parameter is the serialization of the ID content, the return content is displayed in MSG
The second one: The content is empty
The third one: give Defines the Enter key press event, and defines two timers
  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.