Kad Kerforn
2007-Oct-14 17:30 UTC
javascript script not loaded in partial (Ajax gurus... ?°
an Ajax request to my FranchiseController updates my page correctly page.replace_html ''table_list_item'', :partial => ''item_franchise'' page.show ''show_list_item'' performed correctly in my _item_franchise partial view, I have another nested partial to display a list of documents ... <div id="doc_map_area"> <%= render :partial => ''documents'' -%> </div> ... _documents.rhtml view is displaying correctly the list of documents as a tree , using fairly javascript <div id="doctree" class="doctree"> ...<%= get_tree_data(@documents, 0){|n|... and so on... </div BUT at the end of this partial there is a < script type="text/javascript"> .. with some functions to be used when clicking somewhere in the tree, like function toggleMyTree(id) { ... } .. </script> my problem is I GET A JAVASCRIPT ERROR : toggleMyTree is not defined which happen because it seems that the script is not loaded with the partial ... or mybe I am wrong .. something else happen any clue ? thanks a lot for your help -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---