开发者

rails .jr.erb templates

Experiencing jquery in rails through .js.erb templates; but completely puzzled by a simple problem : for some reason, when a certain controller's action is called, it is recalled like two or three times. and on top of that, the number of recalls to the same action increase as the page is used. so i quickly end up with long loops over the same action... there's a real logic in this bug, but still, can get hat it is and how to solve it. ay experiences with tose kind of problems开发者_如何学C ?


Try unbind(ing) the event before attaching it. that helps with my stuff from time to time.

If you are using the live keyword then stop using it. if you are not, then try using it. i know that sounds like rubbish advice but i have done these steps in the past to fix issues exactly like you describe.

also, if on your success of the jquery call, ensure you are not rebinding events on a set of objects defined by a class. that will also add events to controls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜