开发者

Rails Jquery - Metasearch page reload problem

开发者 https://www.devze.com 2023-03-24 03:14 出处:网络
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.

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 c开发者_开发技巧heckbox


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.


I solved my problem with setting render :layout => false when the url got params and did make an ajax request instead and moved my menu to my layout file

0

精彩评论

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