-1

こんにちは、私は ajax 関数を持っていますが、cakephp で目的のコントローラーにリダイレクトできません。

$.ajax( {
    type: "POST",
    url:  "/NewEvents/some_function",
    data:array,
    async: true,
    success: function (data) {
    alert('hello');
}

NewEvents は私のコントローラーで、 some_function はデータを送りたい場所です...

// In my controller file
 function some_function()
 {
       some code.....
 }

そして、出力形式を変更する方法??

誰でも私のコードを手伝ってもらえますか??

4

1 に答える 1

1

以下のコードに従って、ajaxリクエストが正常に完了した後にajax成功関数を使用します。

$.ajax( {
        type: "POST",
        url:  "/NewEvents/some_function",
        data:array, //data you want to pass the
        success: function (data) {
        alert('hello'); // after success hello will alert.
        }
        });
于 2013-04-30T13:40:23.960 に答える