Question

I am using Pnotify statically and would like to get dynamic data now.

I would like for when javascript checks the database for a Boolean value(1) to display the corresponding tables the alert.

(Only one row will ever have the value of 1 set at a time.)

Below id the script that I am using statically that I would like to modify.

<script type="text/javascript">
    $(function() {

        $.pnotify({
            title: 'My Note,
            text: 'Reboot your computer',
            addclass: 'stack-bar-top',
            opacity: '0.89',
        });
    });
</script> 

 tableNotetification 
 -------------------------
 - id (pk)
 - notificationText
 - notificationStatus(Boolean 1= active, 0=inactive) 
Was it helpful?

Solution

you provide very little and it looks like you did nothing at all to accomplish it, so here's the help I'm willing to give to a person that tries nothing at all:

  1. Either you get the database information when the user refresh the page, or you call it through a script method ($.get() for example)
  2. Soon you have the data, simply create a new pnotify object or if there's several alerts, just stack them using the examples from the plugin website.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top