Michael B. 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.