简体   繁体   English

Jnotify jQuery插件用于$ _Get消息

[英]Jnotify jquery plugin to use for $_Get message

I am having problem in using this plugin as i,am saving each of my message is Global variable and want to call the jquery function with that message on each transaction, that is added, edited, deleted. 我在使用此插件时遇到问题,我将我的每条消息保存为Global变量,并希望在每次添加,编辑,删除的交易中使用该消息调用jquery函数。 Here is what i do on sucessful event 这是我在成功事件中所做的事情

    $GLOBALS['info_message']="Record Deleted Sucessfully";
    $loc = $request->homeURL.'dashboard.php?message='.$GLOBALS['info_message'];
    header("Location: $loc");

but i want to display that message(in url) via this jquery function 但我想通过此jQuery函数显示该消息(URL中)

$("a").click(function(e){
        e.preventDefault();
        switch ($(this).attr('class'))
        {
            case 'success' : jSuccess('Congratulations, a success box !!',{
                                VerticalPosition : 'center',
                                HorizontalPosition : 'center'} ); 
                                break;
            case 'notice' : jNotify('Notification : <strong>Bold</strong> !'); break;
            case 'error' : jError('ERROR : please retry !'); break;

        }

    });

(ofcourse not on click function) for each of error, sucess and notice respectively. (当然不是单击功能)分别针对错误,成功和注意。 How can i implement This functionality. 我如何实现此功能。

function message ()

    {
        $.get("dashboard.php",
        {
            message:"Record Deleted Sucessfully"
        },
        function(data,status){
        });
    }

Hope this helps you. 希望这对您有所帮助。

You can call that message() function on success, instead of PHP script. 您可以成功调用该message()函数,而不是PHP脚本。 The above function will do this: 上面的功能可以做到这一点:
It will go on this url: dashboard.php?message=Record Deleted Successfully 它将在以下URL上显示: dashboard.php?message =记录已成功删除

function(data,status){ });
Here data is the returned data on above url (of dashboard.php). 此处的数据是上面的(dashboard.php)网址上返回的数据。 You can simply display it or do anything with it. 您可以简单地显示它或对其执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM