Ruby on Rails Thursday, June 28, 2012

Michael Baldock wrote in post #1061633:
> I'm trying to work out the best way to implement a page with various
> sections.
>
> One section reports statistics about players in a team, the user selects
> from a row of player icons, and underneath this, a set of graphs are
> displayed.
>
> One way I thought of doing this was to have the 'graph view' as an
> iframe, and when the user clicks on the player icon, a new url is loaded
> in the iframe eg root/graphs_controller/graph_for_player/13.

In general, frames/iframes are evil!

> I already have an iFrame for a google maps view also on the page.

But, sometimes a necessary evil.

> Are there any considerations when using iframes? Can they slow the
> loading time?

Technically yes they can. Is it likely to matter? Probably not. Loading
a page with an iframe is effectively the same as loading two separate
pages. There's two requests to the server. The content of the iframe
includes markup not necessary when compared with an AJAX partial page
download.

> Another way to do this would be to use Ajax to reload a partial view on
> the page.

This would almost certainly be the choice I would make myself.

> Would this be quicker / slower?

What do you mean by quicker, performance or development time? If the
former see above, if the latter, well that depends on how skilled you
are with JavaScript and AJAX.

> Any experience / advice on the matter would be appreciated!

AJAX provides a far superior user experience in my view. The current
trend is to build web applications that behave more like desktop
applications, and the web is getting better for it IMHO.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

No comments:

Post a Comment