The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Is the <iframe> acceptable?

This is the situation that I'm in. I have a "main page" from which many programs are called. The main page has tabs and when a tab is clicked, a program is called.

The way I see it, I have a few choices.
1) Add the "header tabs" to every page and load it.

2) Never leave the "main page" but instead, load the called programs in an <iframe>

3) Never leave main page and create sections for each "called program", essentially making the main page ONE big program. When a tab is clicked, the appropriate section is displayed.

The called pages will have data that needs sorted which I do by sending the necessary info to a routine via AJAX which then displays it to the page.

I'm looking to do this correctly, any suggestions? Or is there a good book to read on this sort of thing? I was recommended to a book in another thread but haven't had a chance to research it yet so I don't know if that applies.

Loading one big page might be a bad idea....
If you already make use of httprequests, then why don't do the same to load the contentof your tabs in container div?

By httprequest, you mean AJAX, right?

I can use AJAX but that means the code loaded will not be "a program", right? Actually, this is how I usually use AJAX to populate a <div>, tell me if I'm way off base here.

I send parms to the ajax routine, one of them being a "mode". The mode is in a case statement and a procedure is called based on the mode. The procedure runs code and returns the results.

So basically, if I have a program called pgmA, I would carve out the logic, put it in the procedure to return the results. Then all the CSS/JS files etc needed would go into the <head> of the main program.

How would you adapt an HTML file that is already created to be called via AJAX?

The language is in Webspeed by Progress.

I think this the missing link for me - a typical way of using AJAX. What I do works, but it seems cumbersome.

1. Yes I do mean AJAX.
2. It all depends on your definition of "program". If you mean that the loaded soucre code will not be a stanalone well-formed HTML page, then yes, the loaded components will not be programs
3. If a complete, standalone and well formed document is what you need then loading them in an iframe is a viable alternative.
4. If you want your sub-sections to be able to both stand alone and be part of a parent window and interact with it, you must remember to add "window.parent" to all code that you want executed on the main window.
5. If you could provide a small sample use case it would help better visualize what your exact need is and how to serve it best

This is the situation that I'm in. I have a "main page" from which many programs are called. The main page has tabs and when a tab is clicked, a program is called.

The way I see it, I have a few choices.
1) Add the "header tabs" to every page and load it.

2) Never leave the "main page" but instead, load the called programs in an <iframe>

3) Never leave main page and create sections for each "called program", essentially making the main page ONE big program. When a tab is clicked, the appropriate section is displayed.

The called pages will have data that needs sorted which I do by sending the necessary info to a routine via AJAX which then displays it to the page.

I'm looking to do this correctly, any suggestions? Or is there a good book to read on this sort of thing? I was recommended to a book in another thread but haven't had a chance to research it yet so I don't know if that applies.

....

In terms of SEO using <iframe> on site would bleed the Search Engines. Search engine wont cache this type of websites. Using <iframe> is out of Optimization.

iframe disallows indexing bots as Clyde said (they will get everything outside of the iframe though).

iframe is usually (not always) able to be converted to an "include" system. Each chunk of HTML is in an "include". The ones who never change (like say the header include) means the user has just the single GET request for that chunk. Most templating systems use includes. The backend supplies usually just the "main" area when parts of the menu are clicked (using a regular GET request).

However I can't tell if this is a standard web page or an application (you said "program"). Locking people out of pages of a web site because you chose to use AJAX rather sucks, however if this is an application that is more than acceptable... those without Javascript support simply cannot use the application just as those with ancient hardware cannot install modern programs. But never block information content by requiring scripts.