skip to main
|
skip to sidebar
早鳥
2008年12月13日 星期六
using jquery in rails
jquery railscast
jquery post
$.post(url, data, callback, type)
This is an easy way to send a simple POST request to a server without having to use the more complex $.ajax function. It allows a single callback function to be specified that will be executed when the request is complete (and only if the response has a successful response code). The returned data format can be specified by the fourth paramater. If you need to have both error and success callbacks, you may want to use $.ajax. $.post is a (simplified) wrapper function for $.ajax.
$(document).ready(function(){
$("#new_forum_comment form").submit(function(){
$.post($(this).attr("action")+'.js', $(this).serialize(), null, "script");
return false;
})
})
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)
網誌存檔
▼
2008
(4)
▼
12月
(1)
using jquery in rails
►
8月
(1)
►
5月
(2)
著作人
Lake
早鳥