0

私は jquery Mobile に基づくプロジェクトに取り組んでいます。私はこの分野では大物なので、ばかげた質問で申し訳ありません。問題は - 私はページ 'Page1' を持っていて、ポスト メソッドを使用してデータベースからデータを取得しています。成功すると、通知ダイアログを介してユーザーに通知を表示しています(キャンセルとOKボタンなし)。この成功メッセージを別のページ「page2」に表示したいのですが、メッセージは最大2秒表示され、その後自動的に消えます。私が試してみました

function sendAddGuest(data, dialog) {

    $.post("/GuestsList/AddGuest", data, function (response) {  //using the post method
        //alert(JSON.stringify(response));
        $('.error').html("");
        hideLoading();

        if (response.result == 'success') { //if the process done


                $.mobile.changePage('/GuestsList/Index', { dataUrl: "/GuestsList/Index", reloadPage: false, changeHash: true });    //To another page "page2"

               // window.setTimeout('showToastMessage("Guest added successfully with window");',2000);  //i have tried this                
                setTimeout(function () { showToastMessage("Guest added successfully test2"); }, 100);   //and this also i want to show this message on other page "page2"
    }
}
4

1 に答える 1