javascript - How to fix script after upgrading jQuery to 2.1.4? -
i using jquery 1.8.3 , had piece of script :
$("[src*=plus]").live("click", function () { $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>") $(this).attr("src", "../images/minus.gif"); }); $("[src*=minus]").live("click", function () { $(this).attr("src", "../images/plus-sign.png"); $(this).closest("tr").next().remove(); });
after upgrading jquery 2.1.4, no longer works.
i functions live
not supported anymore unable convert piece make work.
when upgrading jquery should use jquery migrate.
this offically recommended way in finding out has been deprecated in jquery.
if you’re upgrading version before 1.9, recommend use jquery migrate plugin , read jquery 1.9 upgrade guide, since there have been lot of changes. it’s easy use plugin, include in html file after jquery , open browser console see messages generates:
<script src="http://code.jquery.com/jquery-2.0.0.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.1.1.js"></script>
you should jquery upgrade guide.
Comments
Post a Comment