Skip to content

Possibility to "subscribe" to warnings #15

Closed
@dougwilson

Description

@dougwilson

It would be really neat if there was a way to write a function that would be called for a warning instead of only being able to use a console or periodically check jQuery.migrateWarnings. Possibly a event triggered on document when there is a warning?

My use case is a large single page application that uses jQuery around the place. It would be nice to set jQuery.migrateMute = true and add a function that listened for warnings and reported them somewhere custom. Possibly something like:

$(document).on('warning.jqmigrate', function (event, message) {
  handleJqueryMigrateMessage(message);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions