Before I ask my question I have gone through this: Better alternative to an iframe?, and haven’t found a solution to my problem, or maybe I did not understand correctly!
I have a HTML-page which contains a Dojo-tree on the left hand side. When I click on an element on the left-hand tree (Say element1), I load an iframe on the right with a url:
www.something.com?selected=element1
Now the source of the frame is a jsp which does this:
<%
/* Get the user selection*/
String selectedElement = request.getParameter("selected");
/* Code to Fetch some content from the database using the above string */
%>
Since the left hand side tree has many elements, clicking on each element loads the iframe on the right hand side as above. The arrangement works perfectly fine. But I am wondering if this is the best way to do it? Can I some how not use iframes and still obtain the same result? I read somewhere that loading iframes is several times slower than not loading iframes.
Any help will be appreciated!
If the links are in the same domain, you could use jQuery load to populate a DIV instead of an iframe. This would be much better from an organizational perspective and make your page much easier to navigate for people with accessibility issues. If the content is from another domain, you’re stuck with the iframe unless you process the requests on your server.
Dojo example