You are here: Re: Linking to iframe « HTML « IT news, forums, messages
Re: Linking to iframe

Posted by Jonathan N. Little on 10/21/06 14:30

greencw3 wrote:
> Yes, that is correct. I have no desire to show another site's web
> content in my iframe. I only want to be able to externally link to any
> page on my own site so that the page loads in my own site's index.htm
> iframe with all of the visual and navigation aids showing--as if the
> user had gotten to the page by navigating from my home page.
>
> Is there a way around this shortcoming?

Well I previously posted them, but I will reiterate.


#1 Your first and *best* option is to stop using FRAMES|IFRAMES to
insert your common parts like your navigation and use server-side
methods that would allow each page on your site to have a unique URL.
PHP is very commonly available and can be a simple as

<?php include('mymenu.php'); ?>

See: All My FAQs Wiki: Include one file in another
http://allmyfaqs.net/faq.pl?Include_one_file_in_another

Advantage: Everything, it will always work regardless of the browser or
browser settings, transparent to the visitor, separates common parts
of page for easy maintenance, you only have to change the one file to
change your menu, not duplication of markup. Easily upgraded to database
served website which appears to be the trend.

Disadvantage: None really.

#2 Keeping your frames your other options are not so good and I require
fudging, unnecessary complexity, and a maintainability issue. Parsing
and processing a parameter via the URL query string to select the
specific page:

http://www.example.com/index.html?page=aboutus

Then you could use server-side script to load the 'aboutus' page into
the frame.

Advantage: Transparent to the visitor's browse being server-side BUT

Disadvantage: If you have server-side why bother with the IFRAME when
you can do the first option and offer your visitors a static
bookmarkable URL http://www.example.com/aboutus.php rather than a longer
query string: http://www.example.com/index.php?page=aboutus. Without the
IFRAME your inclusion does not have to be relegated the rectangular
IFRAME and your page can have more design flexibility!

#3 Keeping your frames like #2 but using JavaScript to parse the query
string to load desired IFRAME contents.

Advantage: Do not require server-side support *BUT*

Disadvantage: Don't do this because: server-side support is now almost
universally available unlike 10 years ago. This method *will fail
miserably* if JavaScript is not enabled which is becoming an increasing
percentage of your visitors and search engines will not be able to index
your page resulting in few people finding you! And more so just take my
advice, don't do it...


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация