2007년 9월 29일 토요일

[jQuery] Submit form

# post에 전송할 params 생성
var params = {};

$(this)
    .find("input[@checked], input[@type='text'], input[@type='hidden'], input[@type='password'], input[@type='submit'], option[@selected], textarea")
    .filter(":enabled")
    .each(
    function()
    {
       params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value; }
 );

#================================================================
Add a "curWait" class to the body, giving a hourglass symbol
$("body").addClass("curWait");

Post, via AJAX to the current form's action ("dbFormSubmission"), adding a "?call=ajax" to the URL
$.post(this.getAttribute("action") + "?call=ajax", params, function(xml){

댓글 없음:

댓글 쓰기