javascript - Create objects on demand -


I am working in an information system for a web and I am not able to read the unread or read notifications of objects for every notification Get track, for example, I found something like this:

  var Notifications = function () {this.read = false; }; Notifications.protipipip.open = function () {alert ('opening'); } Notifications. Prototype Close = function () {warning ('off'); } Notification.prototype.fatchchinfo = function () {warning (obtaining information from the browser); } Notification. Prototype. Remove = function () {Warning ('Deleting information'); } Var Some Information = New Notification ();  

What I really want to do is create a resiebe like a new notification from a socket at all times:

  socket.on ('Notification' , Function () {var notification 1 = new notification ();});  

And now if you make a new notification

  var notification 2 = new notifications ();  

I would like to know that I can create this notification objects with bi-effects or if you know people in a better way to handle this problem, then I appreciate the people you help. I do

Try an array:

  var notifications = [] ; Socket.one ('notification', function () {var notice = new notification (); notification peash;});  

Each time the event is triggered, the notification should be new:

  var Notification = new notification ();  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -