My AJAX response text includes HTML with a text area populated with javascript code (so that the user can copy and paste the code elsewhere). Ajax, of course, strips out all of the javascript from the response text and the javascript code doesn''t appear in the text area. Here''s what I want the response to look like inside the div: <textarea rows="5" cols="60" readonly onClick="javascript:this.focus();this.select();"> <script type="text/javascript" src="somehost/some.js"</script> </textarea> What I end up with inside the div: <textarea rows="5" cols="60" readonly onClick="javascript:this.focus();this.select();"> </textarea> I don''t want the javascript in the text area to execute, I just want it to display inside the text box. Any ideas?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
i''d think the short answer would be that you need to tell the server to spit the < and > as < > etc this will tell the browser that < and > should be treated as text and not actual code either that or force evalScripts:False possibly have to do both. I just recently (read: last night) found that FF2.0.0.7 will execute JS passed through a Ajax.Request while IE6&7 will not On 9/26/07, tomh <tomhoag-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > My AJAX response text includes HTML with a text area populated with > javascript code (so that the user can copy and paste the code > elsewhere). Ajax, of course, strips out all of the javascript from the > response text and the javascript code doesn''t appear in the text area. > > Here''s what I want the response to look like inside the div: > > <textarea rows="5" cols="60" readonly > onClick="javascript:this.focus();this.select();"> > <script type="text/javascript" src="somehost/some.js"</script> > </textarea> > > > What I end up with inside the div: > > <textarea rows="5" cols="60" readonly > onClick="javascript:this.focus();this.select();"> > </textarea> > > > I don''t want the javascript in the text area to execute, I just want > it to display inside the text box. > > Any ideas?? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Awesome!! Thanks so much for pointing out the obvious! < > are the way to go. thanks again!! tom On Sep 26, 12:47 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i''d think the short answer would be that you need to tell the server to spit > the < and > as < > etc this will tell the browser that < and > should > be treated as text and not actual code > > either that or force evalScripts:False > > possibly have to do both. > > I just recently (read: last night) found that FF2.0.0.7 will execute JS > passed through a Ajax.Request while IE6&7 will not > > On 9/26/07, tomh <tomh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > My AJAX response text includes HTML with a text area populated with > > javascript code (so that the user can copy and paste the code > > elsewhere). Ajax, of course, strips out all of the javascript from the > > response text and the javascript code doesn''t appear in the text area. > > > Here''s what I want the response to look like inside the div: > > > <textarea rows="5" cols="60" readonly > > onClick="javascript:this.focus();this.select();"> > > <script type="text/javascript" src="somehost/some.js"</script> > > </textarea> > > > What I end up with inside the div: > > > <textarea rows="5" cols="60" readonly > > onClick="javascript:this.focus();this.select();"> > > </textarea> > > > I don''t want the javascript in the text area to execute, I just want > > it to display inside the text box. > > > Any ideas??--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---