Jump to content

Working with Frames


sgalatas

Recommended Posts

Guest FirefoxRocks

The frameset page is XHTML 1.0 Frameset, right?So you're saying that the pages need to be XHTML 1.0 Strict, but it needs target attribute on the links? You may wish to consult some of our "experts" on JavaScript so that you can use that target the other frame instead.But my question is: Why use frames?

Link to comment
Share on other sites

You shouldn't, in today's XHTML world, need to use either frames nor tables :) (btw frames aren't in the XHTML 1.0 Strict DTD). Have you tried using CSS to style your page? Generally the "frames" look can be achieved using height/width limited divisions with overflow set to auto, and content can be asynchronously loaded using AJAX.Really, if you want to use frames, don't use XHTML.

Link to comment
Share on other sites

Guest FirefoxRocks
You shouldn't, in today's XHTML world, need to use either frames nor tables :) (btw frames aren't in the XHTML 1.0 Strict DTD). Have you tried using CSS to style your page? Generally the "frames" look can be achieved using height/width limited divisions with overflow set to auto, and content can be asynchronously loaded using AJAX.Really, if you want to use frames, don't use XHTML.
The only use for frames that I can think of is to use <iframe> when loading external XML content into an XHTML pages as Internet Explorer won't handle <object> properly I don't think. But as for frameset pages, you don't really need them.In today's XHTML world, you need to use tables for tabular data, not for layout purposes. Just a little bit of clarification so people don't go "OMG I have <table> in my document, I need to use <div> to organize my numbers!!!" :)
Link to comment
Share on other sites

The only use for frames that I can think of is to use <iframe> when loading external XML content into an XHTML pages as Internet Explorer won't handle <object> properly I don't think.
AJAX and the XMLHttpRequest.responseXML property should do the trick.
Link to comment
Share on other sites

I will try using "div" with width and height . Does this have to be a table as well?
No - say your frame was 300px by 200px, you could do this
<div style="width:300px; height:200px; overflow:auto; ">If you put lots of text here you will see scrollbars appear.</div>

AJAX stands for Asynchronous JavaScript and XML (though the link with XML is rather weak). You can read more about it in the W3Schools AJAX tutorial. It basically involves using a JavaScript script to request a page, which then can be stored to strings and manipulated. The advantage of AJAX (as it was with frames) is that content can be called asynchronously of page loadings. So, say you had your content division, you could make it so that when a link is pressed instead of the page reloading an AJAX function is called which silently and smoothly loads the requested content into the content division. An example of AJAX can be seen used in this forum - click on Edit -> Quick edit, and after clicking "Complete Edit" you will see that the page doesn't reload, instead AJAX has been used to asynchronously send the edited post to the server.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...