好的,所以我有两种方法来执行div刷新
$( #player ).load( /videos/index );
在我的rails应用程序中。一个是通过链接
<a href="#" id="nextb" onclick="$( #player ).load( /videos/index ).unbind();">next</a>
other is through shortcut of that button. And they work fine, until i discovered, that if I refresh player twice in a row through the link, and then through the shortcut, it loads div twicely. If i refresh through the link three times in a row, than through the shortcut, than it s loading div three times. And so on.. So, i ve started to trying configure binds (as I assumed, that was the reason), but there were mo result. Here is my messed up in binds shortcut part of application.js
$(document).ready(function(){;
$(document).bind( keydown , space , function() {
$( #player ).unbind( load );
$( #player ).load( /videos/index );
$(document).unbind();
});
});
我试图通过快捷方式点击链接,但结果相同,所以我认为问题出在加载中。任何建议都会有所帮助。