简体   繁体   中英

Rails Jquery - Metasearch page reload problem

I am using metasearch. I have created a form with checkboxes and each time a checkbox is changed the form is submitted and the page reloads.

The problem is that Jquery forget the state of the checkbox and some content that should appear is hidden.

See my Jquery code and html here: Help removing class with checkbox

If the page reloads and you want to mantain the state (in this case, keep checkboxes clicked), you'll have to pass this info onto the next page.

jQuery is stateless, it doesn't keep or cache any info between requests.

我通过设置render:layout => false来解决我的问题,当url获得参数并且确实发出了ajax请求并将菜单移至布局文件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM