| View previous topic :: View next topic |
| Author |
Message |
MrTouz
Joined: 30 Apr 2007 Posts: 5
|
Posted: Mon Apr 30, 2007 11:21 am change the source of iframe by a external link |
|
|
|
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 i just need this code .... |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8301 Location: Castle Pines North, CO USA
|
|
SteveH
Joined: 11 Apr 2007 Posts: 208
|
Posted: Mon Apr 30, 2007 12:52 pm |
|
|
|
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
|
Posted: Mon Apr 30, 2007 2:01 pm |
|
|
|
| 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
|
Posted: Mon Apr 30, 2007 2:17 pm |
|
|
|
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 ) 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
|
Posted: Mon Apr 30, 2007 2:25 pm |
|
|
|
im a lair it did work...!!!
i just tryed on my desk, and when i tried online, it worked..
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 happyer than anything...
thank you so much !! |
|
SteveH
Joined: 11 Apr 2007 Posts: 208
|
Posted: Mon Apr 30, 2007 2:44 pm |
|
|
|
You're welcome. I'll just treat myself to dinner and pretend it's on you
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
|
Posted: Mon Apr 30, 2007 3:12 pm |
|
|
|
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
|
|
|