Skip to content

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

@BrightLedSigns

Description

@BrightLedSigns

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions