Has anyone used a XmlHttpRequest technique in their code, like google does at http://www.google.com/webhp?complete=1&hl=en ? Info at http://www.sitepoint.com/blog-post-view.php?id=216588 http://jibbering.com/2002/4/httprequest.html http://developer.apple.com/internet/webcontent/xmlhttpreq.html
Well, not my Rails project, but we make extensive use of it at work for our web app. It''s pretty cool stuff. We use it to populate various divs around the application, so the user never actually refreshes the page. We''ve seen some javascript memory leaks while using it in IE, tho. -- Mando On Fri, 17 Dec 2004 13:33:50 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Has anyone used a XmlHttpRequest technique in their code, like google > does at http://www.google.com/webhp?complete=1&hl=en ? > > Info at > http://www.sitepoint.com/blog-post-view.php?id=216588 > http://jibbering.com/2002/4/httprequest.html > http://developer.apple.com/internet/webcontent/xmlhttpreq.html > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
You can see it in action with an hieraki author account ( or on the demo page at http://demo.hieraki.org ) While you type a new page it auto updates a textile preview under the textarea using xml request On Fri, 17 Dec 2004 15:39:18 -0600, Mando Escamilla <mando.escamilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well, not my Rails project, but we make extensive use of it at work > for our web app. > > It''s pretty cool stuff. We use it to populate various divs around the > application, so the user never actually refreshes the page. > > We''ve seen some javascript memory leaks while using it in IE, tho. > > -- > Mando > > > On Fri, 17 Dec 2004 13:33:50 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Has anyone used a XmlHttpRequest technique in their code, like google > > does at http://www.google.com/webhp?complete=1&hl=en ? > > > > Info at > > http://www.sitepoint.com/blog-post-view.php?id=216588 > > http://jibbering.com/2002/4/httprequest.html > > http://developer.apple.com/internet/webcontent/xmlhttpreq.html > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://blog.leetsoft.com
forgot to send this to the list... I think. ---------- Forwarded message ---------- From: Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Date: Fri, 17 Dec 2004 13:57:47 -0800 Subject: Re: [Rails] xml http request To: Mando Escamilla <mando.escamilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Idea: So, you could do form input validation on the fly using XmlHttpRequest, couldn''t you? So, when the user leaves an input element, you do a query and check to see if what the user entered was valid, and display the results inside a div or something. That would provide instant feedback to the user, and they wouldn''t have to submit the form to see what errors they made. On Fri, 17 Dec 2004 13:53:24 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It looks like you don''t have to use XML as the object being > returned... you could use YAML? > > > On Fri, 17 Dec 2004 15:39:18 -0600, Mando Escamilla > <mando.escamilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Well, not my Rails project, but we make extensive use of it at work > > for our web app. > > > > It''s pretty cool stuff. We use it to populate various divs around the > > application, so the user never actually refreshes the page. > > > > We''ve seen some javascript memory leaks while using it in IE, tho. > > > > -- > > Mando > > > > > > On Fri, 17 Dec 2004 13:33:50 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Has anyone used a XmlHttpRequest technique in their code, like google > > > does at http://www.google.com/webhp?complete=1&hl=en ? > > > > > > Info at > > > http://www.sitepoint.com/blog-post-view.php?id=216588 > > > http://jibbering.com/2002/4/httprequest.html > > > http://developer.apple.com/internet/webcontent/xmlhttpreq.html > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > >
There seem to be a lot of uses for XmlHttpRequest, both in function and interface. However, looking at the Hieraki code, it appears as if it never renders part of a Rails page, only plain text from a form. I''ve banged around with this a little bit, and have found that if you make a small .rhtml page and have an XmlHttpRequest open it and display it inside a div on your page, which is one way to achieve very nice GUI interaction with a web application, then Rails doesn''t render the tags. Rather, they are simply displayed on the screen as if it were text. For example, <%= text_field( ... ) %> is displayed, rather than a text box form element. Is there, by any chance, some way to execute the .rhtml file before passing it to the XmlHttpRequest loader function? Or perhaps some other way around this problem ... PHP seems to do it by sending the request to a PHP function which returns the file to use. Can we do that?
> For example, <%= text_field( ... ) %> is displayed, rather than a text > box form element. Is there, by any chance, some way to execute the > .rhtml file before passing it to the XmlHttpRequest loader function?Yep, request a controller+action rather than a view directly. Just make XmlHttpRequest GET a standard rails URL and populate the data as per normal. Requesting the .rhtml files directly breaks MVC, and isn''t very useful as there''ll be no @vars for the script to use.> Or perhaps some other way around this problem ... PHP seems to do it > by sending the request to a PHP function which returns the file to > use. Can we do that? > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz