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