0

This error appeared for me for the first time today. I'm using Firefox 28 which seems to be the most recent version.

Here is the code: When it gets to the last line I get the error "Can't access dead object" and the page freezes, won't accept clicks anymore. Not seeing this error in Chrome.

function setCookie(name, value, expiredays) {
    console.log("setting cookie to: " + name + ", value: " + value);
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    var newcookie = name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toGMTString());
    document.cookie = newcookie;
}

When I look at document.cookie in the console, it's just a string. newcookie is a string too. Document looks alright.

dead code error

What is this error?

Thanks for any clues

slashdottir
  • 7,835
  • 7
  • 55
  • 71

2 Answers2

1

Only thing you have missed ) on below code,

...((expiredays === null) ? "" : ";expires=" + exdate.toGMTS)
                        //closeing bracket is missed--------^

Otherwise cookie is setting/getting to/from Firefox 28 without any problem.

Updated

DEMO

Suman Bogati
  • 6,289
  • 1
  • 23
  • 34
  • Sorry, that was a cut and paste error while composing the question. The line got chopped, but it is corrected now. Thank you – slashdottir Apr 11 '14 at 17:39
0

It seems that Firebug needed to update itself. Closing Firefox entirely and restarting it presented an update tab for Firebug. Updating firebug made this error go away.

thank you

slashdottir
  • 7,835
  • 7
  • 55
  • 71