need a iframe like script. maybe?

rooster

New Member
Hey all
I have been using iframes. I know they are old and outdated, so I am looking for something else.
Is there a script or program or something that I can create my layout and have it automatically put on every page?
I have the layout I want, but everytime I update the menu, I don't want to have to go into every page that I created and add the link. I want to be able to go into one file and change it.
Using iframes, when the person goes to your website, it loads the index.html obviously, and then you click the link and it loads in the frame. So I only have to edit it once.
There are a list of reasons why I shouldn't use iframes, so I would like to find a way around using them.
Thanks!
 

conor

New Member
It's hard to say without looking at your site, could you post a link or something? if you don't have hosting you could set up an example on http://jsfiddle.net/

With jquery you can do the same thing as iframes do quite easily. You should look into the $.ajax method, heres a quick example:

Code:
$(function(){ // when the page is loaded
   $.get( 'urltoload', function( html ){ // load the url
       $( '#div' ).html( html ); // add the content returned by the page to #div
   });
});
 

rooster

New Member
my website is tkleather.com
but i am changing it. totally changing it. i am scraping it and starting over.
new color scheme, less beveling and embossing, less shadowing, less graphics in general. im going to make a text based menu not graphics based.
but i dont want the frames. none at all.
its not a bandwidth issue that im using frames. its just what i remembered.

heres just an example of what i am talking about. if you go to skipsboots.com, notice the left menu bar is there. always. when a link is clicked, the whole page reloads. not just a frame. but if they want to add a link to the left - they can add it to one page, and it automatically updates on every page.
i was looking at their source, and it looks like they use jquery. but i dont have the slightest clue what jquery really is. or now to even start to attempt to use it.

also, i would like to make the table on the left to go all the way down, regardless how much content i have in the main section. i may use an accordion style menu, so it would look better with the table going all the way down.

thanks again for any help.
 

Phreaddee

Super Moderator
Staff member
1. Use php includes for the menu
2. Jquery is a js library and very easy to use.
3. Dont, please dont, even for one second, consider starting the body content with <table>
Or the left menu or ANY OF IT! Unless of course it is tabulated data...
 

rooster

New Member
Okay so I figured out how to use the php includes for the header, menu and footer.

Now I have another small situation.
When I add content to the main section of the page, I can't get the menu to automatically reset to the whole length of the page. I want the menu to automatically load to the length of the page. (Well from the bottom of the header and top of the footer).

Also, why is adding the table so bad?
When I add the php include code for the menu, I can't seem to make content load to the right of the menu without using tables.
 

rooster

New Member
I could probabaly figure out how to make it work without tables. I just have to try it out tonight.
But I still need to figure out how to make the menu go all the way down.
 
Last edited:

Phreaddee

Super Moderator
Staff member
Code:
#menu {
Float:left;
Margin:0;
Padding:10px;
Width:180px;
}
#content {
Float:left;
Margin:0;
Padding:10px;
Width:740px;
}
HTML:
<div id=“menu“>
... Php include ...
</div>
<div id=“content“>
... Content goes here ...
</div>
That'll solve the issue with the content next to the menu.
As for the other issue with the menu “reaching“ the footer.
Google faux columns, and while your at it, google why tables for websites sucks.
As i cant be bothered to explain it...
 
Top