0

Hi i am using quick note plugin. In IE8 i am getting the error Object doesn't support this property or method, have no idea how to solve this, I am getting this error on below code

error here ->

$.fn.postitall.defaults = {
    // Basic Settings
    id              : 0, //Id
    created         : Date.now(),
    domain          : window.location.origin, //Domain in the url
    page            : window.location.pathname, //Page in the url
    backgroundcolor : '#FFFC7F', //Background color
    textcolor       : '#333333', //Text color
    textshadow      : true, //Shadow in the text
    position        : 'relative', //Position absolute or relative
    posX            : '5px', //top position
    posY            : '5px', //left position
    height          : 180, //height
    width           : 200, //width
    minHeight       : 152, //resizable min-width
    minWidth        : 131, //resizable min-height
    description     : '', //content
    newPostit       : false, //Create a new postit
    autoheight      : true, //Set autoheight feature on or off
    draggable       : true, //Set draggable feature on or off
    resizable       : true, //Set resizable feature on or off
    removable       : true, //Set removable feature on or off
    changeoptions   : true, //Set options feature on or off
    savable         : false, //Save postit in local storage
    // Callbacks / Event Handlers
    onChange: function () { return 'undefined'; },
    onSelect: function () { return 'undefined'; },
    onDblClick: function () { return 'undefined'; },
    onRelease: function () { return 'undefined'; }
};
1
  • 2
    The code you posted is unlikely to throw that error. Unless postitall is undefined...
    – Cerbrus
    Commented Jul 13, 2015 at 7:12

1 Answer 1

1

Date.now wasn't added to Javascript specification until ECMAScript 5 which means that it is not present on IE8 and lower. This is why you get the mentioned error. However, you can implement your own Date.now() method:

/** +new Date is short for (new Date).valueOf(); */
var Date.now = Date.now || function(){ return +new Date; };

So, if Date.now exists you will use existing browser's implementation, otherwise you define your own function.

Not the answer you're looking for? Browse other questions tagged or ask your own question.