Your solution is not incorrect, and your fix does the job, but I think a little background information on it would not hurt.
Note that what causes the warning is the jQuery Migrate plugin.
It is for providing backward compatibility for code depending on older jQuery versions. If you do not want to be warned about deprecated features and how to update them to the current standard, you can disable the warnings with the following line of code:
jQuery.migrateMute = true;
Note that these warnings only happen with the development version of jQuery Migrate, so if you switch to the minified version of jquery migrate (jquery-migrate-1.0.0.min.js
) this line is not even required.
Also note that you are using the development versions of the jquery files, in a production environment you should use the minified versions, so your fix would need to be also implemented in jquery.validate.unobtrusive.min.js
.
So all in all:
- You do not need to fix it, if you use the jQuery Migrate plugin (which you do).
- That warning can be disabled.
- That warning will not show up in a production environment (if the correct scripts are used).
- Microsoft will hopefully fix it anyway in the next version of jquery.validate.unobtrusive
- If you DO fix it, make sure you also fix it in the minified version.
- The only benefit of fixing it will be that you can drop the jQuery Migrate plugin (which I only recommend if you are absolutely sure that there is no javascript in your app depending on legacy jQuery features).