I Have used Ajax and JQuery link to enable new and close functionality problem scenario: * While using ajax link to open the new content and closing the same using Jquery link its working fine wherein the same does not happen again while we try to open the new content immediately after closing the "New content" * The above said works fine only while we refresh the page How to resolve it ?
For example <%= link_to_remote ('New', :url => new_expense_expense_session_path,:update=>"expense_session_new_edit_content") %> <div id="expense_session_new_edit_content"></div>
<a href='#' id='close_session'>close</a> <script type="text/javascript"> $(document).ready(function() { $('a#close_session').click(function(){ $('#expense_session_new_edit_content').fadeOut("1000"); }) }); </script>