开发者

Prototype, periodically_call_remote, updated content disappears when new link is clicked and lags

开发者 https://www.devze.com 2022-12-14 21:11 出处:网络
periodically_call_remote is a great rails feature, but with ease comes novices so here I am. I have a div that is getting updated with content every 5 seconds. Looks great and was easy to setup. This

periodically_call_remote is a great rails feature, but with ease comes novices so here I am.

I have a div that is getting updated with content every 5 seconds. Looks great and was easy to setup. This page is the homepage so people will not be staying here long. So when they click another link, such as link_to "All Products", periodically_call_remote creates two displeasing issues.

1) For one thing, periodically_call_开发者_JAVA百科remote doesn't stop when a html link is clicked and I believe that this is causing the lag in response to open the selected page.

2) Also, when an html link is clicked the content inside the updated div disappears.

Any conceptual solutions?


This only occurred in FF because I had a div inside the updating div which had my content and that middle div had no purpose.

For example.

<div id="main_div">  
   <div class="div_with_no_purpose">  <<=== problem div
       <div id="div_getting_updated">  <<=== content goes here
       </div>
   </div>  
</div>
0

精彩评论

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

关注公众号