ruby on rails - Jquery click event does not execute on first click -


I do not understand that I have to click the link twice in Zakia:

 Click the $ (function () {$ ("(# more_reviewers") (function () {$ ("# reviewer_list"). Html ("& lt;% = escape_javascript (render 'restaurants / restaurant_reviewer_list' ,: venue = & Gt; @ restaurant, limit = & gt; @ restaurant.reviews.count)%> ");});});   

When I click, the view overrides the boundary of the show and shows all the reviewers. I do not get it, so I have to click on a single button twice. None of the other responses of similar questions are working for me because I do not have cookie reliance in this problem, or nothing I am not doing.

I have just tested one more thing: When I showed the event type, it does not show anything for the first time (such as the JS script was not bound to the link), secondly, the correct event type ("Click").

The link id with "more_reviewers" in the rail is as follows:

    

The link shows the correct item, but only after clicking twice (for the first time, do not see anything changing on the page)

Help greatly appreciated

Your show.js.erb should only be included in:

 < Code> $ ("#reviewer_list"). Html ("& lt;% = escape_javascript (render 'restaurant / restaurant_revier_list' ,: site = & gt; @ restaurant ;: limit = & gt; @ restaurant.%.%)% & Gt;");   

Right now you are binding a click event on this link already clicked, which means that you have to click it again.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -