Jnotify jquery plugin to use for $_Get message

281 Views Asked by At

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. 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

$("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.

1

There are 1 best solutions below

1
user1735921 On
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. The above function will do this:
It will go on this url: dashboard.php?message=Record Deleted Successfully

function(data,status){ });
Here data is the returned data on above url (of dashboard.php). You can simply display it or do anything with it.