"try { Element.hide("add_answer_link_for_post_-613772418"); Element.update("new_answer_form_for_post_-613772418", "<form action=\"/answers\" method=\"post\" onsubmit=\"new Ajax.Request(''/answers'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">\n<fieldset>\n <legend>New Answer</legend>\n <textarea cols=\"40\" id=\"answer_ans_string\" name=\"answer[ans_string]\" rows=\"10\"></textarea>\n <input name=\"commit\" type=\"submit\" value=\"Create\" />\n</fieldset>\n</form>\n\n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''Element.hide(\"add_answer_link_for_post_-613772418\"); \nElement.update(\"new_answer_form_for_post_-613772418\", \"<form action=\\\"/answers\\\" method=\\\"post\\\" onsubmit=\\\"new Ajax.Request(\''/answers\'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\\\">\\n<fieldset>\\n <legend>New Answer</legend>\\n <textarea cols=\\\"40\\\" id=\\\"answer_ans_string\\\" name=\\\"answer[ans_string]\\\" rows=\\\"10\\\"></textarea>\\n <input name=\\\"commit\\\" type=\\\"submit\\\" value=\\\"Create\\\" />\\n</fieldset>\\n</form>\\n\\n\");''); throw e }" I want to eliminate this problem wen i m implementing ajax requests.. Please help.. This is the error..Can u please guide? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> This is the error..That''s not an error, thats the script that should be run on the page when the request completes. Are you sure you''re submitting an ajax request, and not just a regular request? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Manish Belsare wrote:> "try { > Element.hide("add_answer_link_for_post_-613772418"); > Element.update("new_answer_form_for_post_-613772418", "<form > action=\"/answers\" method=\"post\" onsubmit=\"new > Ajax.Request(''/answers'', {asynchronous:true, evalScripts:true, > parameters:Form.serialize(this)}); return false;\">\n<fieldset>\n > <legend>New Answer</legend>\n <textarea cols=\"40\" > id=\"answer_ans_string\" name=\"answer[ans_string]\" > rows=\"10\"></textarea>\n <input name=\"commit\" type=\"submit\" > value=\"Create\" />\n</fieldset>\n</form>\n\n"); > } catch (e) { alert(''RJS error:\n\n'' + e.toString()); > alert(''Element.hide(\"add_answer_link_for_post_-613772418\"); > \nElement.update(\"new_answer_form_for_post_-613772418\", > \"<form action=\\\"/answers\\\" method=\\\"post\\\" onsubmit=\\\"new > Ajax.Request(\''/answers\'', {asynchronous:true, evalScripts:true, > parameters:Form.serialize(this)}); return false;\\\">\\n<fieldset>\\n > <legend>New Answer</legend>\\n <textarea cols=\\\"40\\\" > id=\\\"answer_ans_string\\\" name=\\\"answer[ans_string]\\\" > rows=\\\"10\\\"></textarea>\\n <input name=\\\"commit\\\" > type=\\\"submit\\\" value=\\\"Create\\\" > />\\n</fieldset>\\n</form>\\n\\n\");''); throw e }" > > > I want to eliminate this problem wen i m implementing ajax requests.. > Please help.. > > > This is the error..Can u please guide?Looks like this is from a View link_to_remote to replace or change the content on a page. The Controller should have render :update do |page| page.replace_html ''id_of_element'', "content to change" end It would be best to post the View and Controller code so we can assist. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.