HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
change the source of iframe by a external link
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
MrTouz



Joined: 30 Apr 2007
Posts: 5

PostPosted: Mon Apr 30, 2007 11:21 am     change the source of iframe by a external link Reply with quote

ok, i got the whole i frame thing learned so i know how to make an iframe.

right now, my first page will open the iframe with src="welcome.html" so when ever i got to www.plan-z-mod.com it will show me the welcome.html page. now if i go on about, what it will do is, target the about.html inside the name="maincontent".

now what i want to do, is for once, tell the browers to directly go to the about page. so open www.plan-z-mod.com but not go on welcome, but on about.html.

what i want to do is link my about page from an external website, and i cant do it, all i can say is go here and than hit the about page. and i cant do a href="http://www.plan-z-mod.com/about.html" because it will show me only the content of the page and not the site ... remember its an iframe...

****

im sure its possible to link it, but i donno how :/

if anyone of you didnt understood me i will be plaised to re explain, since this is driving me crazy Smile i just need this code ....
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8301
Location: Castle Pines North, CO USA

PostPosted: Mon Apr 30, 2007 11:48 am     Reply with quote



That's the problem when using frames. You can't just point to a specific URL. Well you can, but then you lose the navigation or whatever else you had.

Included Content has some other suggestions on what to use

_________________
Corey
Toll Free Fax Numbers | Mile High Merchant Accounts
SteveH



Joined: 11 Apr 2007
Posts: 208

PostPosted: Mon Apr 30, 2007 12:52 pm     Reply with quote

Make your external links like this:

Code:

<a href="index.html?about.html">Learn About Plan-Z Modding!</a>


Include the following script in the head of your index.html page:

Code:

<script type="text/javascript">
  function loadExtLink() {
    var refURL=window.location.href;
    var loadPage=refURL.split('?');   
    if(loadPage[1]) {
      document.getElementById('mainframe').src=loadPage[1];
    }
  }
</script>


Add onload="loadExtLink()" event to your body tag on the index.html page:
Code:

<body onload="loadExtLink()">
MrTouz



Joined: 30 Apr 2007
Posts: 5

PostPosted: Mon Apr 30, 2007 2:01 pm     Reply with quote

i was about to convert all my frames to no frames and creat a absi page for all my content, BUT i saw your last post and i am about to test it right now.
MrTouz



Joined: 30 Apr 2007
Posts: 5

PostPosted: Mon Apr 30, 2007 2:17 pm     Reply with quote

not working :/

well it is but its not :/

Ok, i did set it on my pc, so i have this file db.html (donno why db Razz) inside i put the link you showed me, i set the header and set the body.

when i hit this link, it actualy directly goes to the about. so its all great.

But now, my forums wich is one path after.. http://www.plan-z-mod.com/forums inside of it i want when ever i hit about it goes to about so instea of putin :

Code:
<a href="index.html?about.html">Learn About Plan-Z Modding!</a>


i puted

Code:
<a href="http://www.plan-z-mod.com/index.html?about.html">Learn About Plan-Z Modding!</a>


nut than it doesnt work :/
MrTouz



Joined: 30 Apr 2007
Posts: 5

PostPosted: Mon Apr 30, 2007 2:25 pm     Reply with quote

im a lair it did work...!!!

i just tryed on my desk, and when i tried online, it worked.. Smile

OMG, i donno what to say, i am .. OMG, oh.. OMG,

thank you, thank you, thank you

so MUCH

.. dude, you made a guy happy Smile happyer than anything...

thank you so much !!
SteveH



Joined: 11 Apr 2007
Posts: 208

PostPosted: Mon Apr 30, 2007 2:44 pm     Reply with quote

You're welcome. I'll just treat myself to dinner and pretend it's on you Very Happy

Should you have a problem loading the iframe when it's in frameset, change

Code:
var refURL=window.location.href;


to:
Code:
var refURL=parent.window.location.href;


Rock on, code monkey.
MrTouz



Joined: 30 Apr 2007
Posts: 5

PostPosted: Mon Apr 30, 2007 3:12 pm     Reply with quote

till working great

but when i changed some link, i messed up my forum, http://www.plan-z-mos.com/forums if you look at the inks its the system you gave me. thanks again.

but now, i have to find my error, i cant login or see my amin panel :/ im givign my self til tomorow morning, and if i dont find out.. ill just re do the whoe design... re do 6 hours of work :/ OMG...
SteveH



Joined: 11 Apr 2007
Posts: 208

PostPosted: Mon Apr 30, 2007 3:53 pm     Reply with quote

[working link: http://www.plan-z-mod.com/forums]

The forum looks great inside your template.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial