私はASP.NETMVC3 +JQueryMobileアプリケーションを次のようなレイアウト構造で使用しています。
<body>
<div class="page" data-role="page" data-add-back-btn="true" id="page">
<div data-role="header" data-position="fixed"></div>
<div data-role="content" id="content">
@RenderBody()
</div>
<div id="footer" data-role="footer" data-position="fixed"></div>
</div>
</body>
問題は、ウィンドウにバインドされたイベントハンドラーが数ページスタックすることです。
たとえば、2つのページがあります:"Index"
と"About"
。私は"Index"
いくつかのハンドラーをバインドします(たとえばconsole.log("index"))
、$(window).click()
イベントについて。しかし、"About"
ページに移動すると、このハンドラーはまだアクティブです。
適切なページがアクティブな間だけハンドラーを保持する方法はありますか?