mercredi 22 avril 2015

Making an object in jquery

I am trying to make an object called event on selection of a date in date picker in a web form in jquery.I am pasting my code but it doesnt show anything although I have applied css styles to the classes I set on them like "pink". here the variable events is an array to store events.

 $(document).ready(function () {
          $("#datepicker").datepicker({
              onSelect: function (date) {
                   display(date)

                  var result = window.prompt("enter event");

                  events[new Date(date)] = new Event(result, "pink");
                  alert("here"+date);
                  var event = events[date];
                  if (event) {
                      return [true, event.className, event.text];
                  }
                  else {
                      return [true, '', ''];
                  }

              }
          })
      });

here is my code for event

var Event = function (text, className) {
    this.text = text;
    this.className = className;
};

can somebody please tell me why isnt it showing me anything?




Aucun commentaire:

Enregistrer un commentaire