Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
[Basic] Iframes ? Or what's the best option do deal with this?
Old 08-25-2009, 09:08 AM [Basic] Iframes ? Or what's the best option do deal with this?
Junior Talker

Posts: 1
Name: No
Trades: 0
Hey all,

I have a horizontal menu with 3 links in it. Now when you press the first link, I want to display file "1.html" in the right column. And after you pressed 2 , "2.html" displays , and so on.

Now, what's the best way to do this ? I think this is quite easy, but I just can't figure out how to do it.
dragger40 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-25-2009, 09:14 AM Re: [Basic] Iframes ? Or what's the best option do deal with this?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The best way is to make separate pages as you would normally. There is not a point in using frames for this, and JavaScript will be less accessible than normal content. Because of caching, shared content on separate pages will lend itself to the illusion that only one part of the page is changing.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-30-2009, 12:00 AM Re: [Basic] Iframes ? Or what's the best option do deal with this?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Use Frames for that purpose.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 08-30-2009, 02:03 AM Re: [Basic] Iframes ? Or what's the best option do deal with this?
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
Quote:
Originally Posted by Brian07002 View Post
Use Frames for that purpose.
no.no.no.
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 08-30-2009, 04:28 AM Re: [Basic] Iframes ? Or what's the best option do deal with this?
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Quote:
Originally Posted by wayfarer07 View Post
The best way is to make separate pages as you would normally. There is not a point in using frames for this...
Agreed. Use some type of an include if you can. Otherwise just code it in each page because you are using doing a small scale site and it's better than iframes.
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
Old 08-30-2009, 10:39 AM Re: [Basic] Iframes ? Or what's the best option do deal with this?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Just for arguments sake, it is actually possible to do this with an IFRAME, without JavaScript:
HTML Code:
<a href="/path/to/page2.html" target="my-iframe">Go</a>
<iframe src="/path/to/page1.html" name="my-iframe"></iframe>
Note that the target attribute of the A is the same as the name attribute of the IFRAME. Although this method should normally never be used like this, it is nice to know the theory of how it works, in case you ever need to use it for a web application.

A FORM may also target an IFRAME, which is a real-life practical usage of the target attribute. This is useful if you want your form to submit without reloading the page. Normally you would want the IFRAME hidden in this case.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-30-2009, 11:11 PM Re: [Basic] Iframes ? Or what's the best option do deal with this?
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
If your server supports PHP.
Here is a PHP include that I use.

This goes in the main page (index.php), in a div where you want to include the different pages.

PHP Code:
<?php
    $page 
$_GET['page'];
    
$pages = array('content''contact''links' );
    if (!empty(
$page)) {
        if(
in_array($page,$pages)) {
            
$page .= '.php';
            include(
$page);
        }
        else {
        echo 
'Page not found. Return to
        <a href="index.php">index</a>'
;
        }
    }
    else {
        include(
'center-home.php');
    }
?>
This line needs to be edited, each of the files you want to include need to be named here:
PHP Code:
 $pages = array('content''contact''links' ); 
So you may have pages named include1.php and include2.php - so you would change that line as:
PHP Code:
 $pages = array('include1''include2' ); 
Then your menu link would be:
HTML Code:
<a href="index.php?page=include1">Link</a>
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Reply     « Reply to [Basic] Iframes ? Or what's the best option do deal with this?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.47291 seconds with 12 queries