Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing the returnValue property of an event triggers warnings in chrome #3

Open
BrightLedSigns opened this issue May 20, 2014 · 2 comments

Comments

@BrightLedSigns
Copy link

Line 623 of the current source has this:

returnValue = ( ev.returnValue === YES ); break;

This triggers the following warning in Chrome's console:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

The warning from Chrome is a bit off...since you are testing ev.returnValue, and not setting it, using ev.preventDefault() isn't really the right answer.

I'm not experienced with javascript and events, so I didn't create this as a pull request, but the following seems like it would fix the issue with as little additional code as possible:

"returnValue" in ev && returnValue = ( ev.returnValue === YES ); break;:

Also, thanks for writing defer.js...we're using it in development for a revamped version of one of our ecommerce sites. The boost in page load times is significant, and I found this much easier to use than the other javascript async loaders I tried.

@wessman
Copy link
Owner

wessman commented May 23, 2014

That’s for the heads-up! I’ll look into implementing a fix along the line you suggested in the near future.

Also, it’s great to hear you’re finding defer.js useful!

@BrightLedSigns
Copy link
Author

Just noticed my fix only quiets the first complaint from chrome at page load time, but it complains later if an event fires. Confirms my lack of experience in that area :)

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

No branches or pull requests

2 participants