Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 6th, 2005, 02:43 AM
arjan arjan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 arjan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation iframes (load a page in an iframe in another page?)

Hi there,
I'm running into this problem:

I've got a page with navigation-categories on the left.
which loads the content in the iframe ('content' for example) on the right.

But there's also an index page, without this iframe.
You can click from here to some content pages, but that means the source of 'content' iframe is not the default source. It depends on which link the user clicks.

Can I give a variable with it or something like that?

I don't want the make the left-navigation in every other page, because it's a lot of work to make changes in every single page...

Who can help me out?

Thanks a lot!

Reply With Quote
  #2  
Old January 6th, 2005, 07:46 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
A possible solution to this could be to use a server-side language...

Have the index page pass a simple variable in the query string, then have the page with `nav & iframe` use that variable to determine what to put in the iframe's contents by default.

Using PHP as an example:
If your navigation contents are "Work - About Us - Something else", the links could be "nav.php?action=work", "nav.php?action=about_us", "nav.php?action=something"

I would then put the following block of code at the very top of the page
PHP Code:
switch($_GET['action']) {
    case 
'work'$src='work.html'; break;
    case 
'about_us'$src='about.html'; break;
    case 
'something'$src='else.html'; break;
    default: 
$src='default.html'; break;



And when you declare your iframe, do it as follows:
<iframe src ="<?=$src;?>"></iframe>

Notice, I've used PHP as an example.
This is absolutely possible with most other web programming languages using the same technique (but slightly different syntax).

Reply With Quote
  #3  
Old January 6th, 2005, 08:20 AM
arjan arjan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 arjan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yeah I actually need a code in Java/html

Reply With Quote
  #4  
Old March 14th, 2005, 01:58 PM
cpgysen cpgysen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 cpgysen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m
Reputation Power: 0
same problem

i am having a similar problem, we start the same, only i would like visitors to be
able to go to a certain page from, say an email, only i cant link directly to that
page, or it will be lacking the 'border' that is usually around it... since said page
sits in an iframe... is there a query that i can give the html like:
www.mydomain.com/?'iframename'=newcontent.html
??
any help would be cool thanks

Reply With Quote
  #5  
Old March 14th, 2005, 02:33 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
If you use JSP/PHP/ASP/whatever, it's all the same programming concept as my earlier post.

Send a variable, via the query string, and use the server-side language to decide what to do.

Have a page that would sort of act as a Front Controller.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > iframes (load a page in an iframe in another page?)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT