Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Time argument for .close() #3

Closed
rayshan opened this issue Jan 11, 2014 · 2 comments
Closed

Time argument for .close() #3

rayshan opened this issue Jan 11, 2014 · 2 comments

Comments

@rayshan
Copy link

rayshan commented Jan 11, 2014

Hi, thanks for the library. Can we have .close() take a time argument and execute after time passes? I tried window.setTimeout(n.close, 1000) and got a TypeError: Illegal invocation error. Probably has something to do with this:
https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout#The_.22this.22_problem

@MrSwitch
Copy link
Owner

As a polyfill for older browsers this API is limited by the spec at http://www.w3.org/TR/notifications/

Please instead use ...

window.setTimeout(function(){n.close();}, 1000); 

Thanks

@rayshan
Copy link
Author

rayshan commented Jan 14, 2014

Sticking w/ the specs is a very good argument. Thanks for the tip Mr. Switch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants