The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Tabbed Document Viewer
feldoln
post Feb 1 2007, 07:44 PM
Post #1





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



OK, i got this code, which works perfect when i save it as a simple HTM file.
here it is: Example

P.S - I'm using geocities for examples only please excuse ads.

Anyway - that works fine on it's own, however, when i put that onto a custom page on my actual website, it opens the tabs / links in the same page, but not in the frame.
Here is a link to a text document of the code: Problem Code

If anyone can offer any form of help or suggestions please don't hold back. I'm not great at HTML, and it may be a simple solution for experts, or some other people.
Thanks, Kyle.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
feldoln
post Feb 1 2007, 07:46 PM
Post #2





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



ok something i just found out lol.

it works in a htm file when not online, and doesn't work when online.

If you want to know what im talking about try downloading example 1 and run it from your documents. the sites then stay in frame.

This post has been edited by feldoln: Feb 1 2007, 07:49 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
feldoln
post Feb 1 2007, 08:05 PM
Post #3





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



heres another example of a simple website i did for an awards system in a clan for ogame.

Notice that the pages are kept within frame:
Working code

Here is the exact same code on my website, which does not seem to work
Notice that the pages open the whole site:
Broken Code
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Effovex
post Feb 1 2007, 08:19 PM
Post #4


Serious Coder
*****

Group: Members
Posts: 251
Joined: 6-January 07
From: Sherbrooke, Qc, Canada
Member No.: 1,477



My Javascript error console indicates the handlelink function is undefined in the broken page. Seems a good explanation tongue.gif You probably forgot to paste in the relevant javascript.

Your page is really terribly coded. You might want to clean up the code to make editing and debugging easier (keep the script elements in the head, don't use javascript to duplicate HTML functions (why aren't you using the target attribute?), and so on)

This post has been edited by Effovex: Feb 1 2007, 08:20 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
feldoln
post Feb 2 2007, 02:29 AM
Post #5





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



I'm afraid just I'm not good enough to do what your saying. i only know HTML as it was the first language i looked at, but i don't know anything much of javascript.

QUOTE("Effovex")
you probably just forgot to paste in the relevant javascript

is there something i missed in the code that you have spotted or do you just have a feeling i may have missed a section in the code?

Is this code worth working on? or should it just be abandoned?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Effovex
post Feb 2 2007, 03:05 AM
Post #6


Serious Coder
*****

Group: Members
Posts: 251
Joined: 6-January 07
From: Sherbrooke, Qc, Canada
Member No.: 1,477



HTML
<ul id="tablist"><li><a class="current" href="http://www.google.com" onClick="return handlelink(this)">Google</a></li><li><a href="http://www.ogame.co.uk" onClick="return handlelink(this)">Ogame.co.uk</a></li><li><a href="http://www.ogame.org" onClick="return handlelink(this)">Ogame.org</a></li><li><a href="http://www.ogame.de" onClick="return handlelink(this)">Ogame.de</a></li></ul><iframe id="tabiframe" src="http://www.google.com" width="100%" height="550px"></iframe><form name="tabcontrol" style="margin-top:0"><input name="tabcheck" type="checkbox" onClick="handleview()"> Open tab links in browser window instead.<br /></form>


If you look at every link, it has a part that says onClick="return handlelink(this)". This is a call to a Javascript function that would make the page open in the iframe, unless the checkbox at the bottom was checked, except the javascript function isn't actually there. I'd recommend removing the checkbox and form, and removing all the onclick events and replacing them with target="tabiframe" so that it looks like so instead:

HTML
<ul id="tablist">
<li><a class="current" href="http://www.google.com" target="tabiframe">Google</a></li>
<li><a href="http://www.ogame.co.uk" target="tabiframe">Ogame.co.uk</a></li>
<li><a href="http://www.ogame.org" target="tabiframe">Ogame.org</a></li>
<li><a href="http://www.ogame.de" onClick="return handlelink(this)">Ogame.de</a></li>
</ul>
<iframe id="tabiframe" src="http://www.google.com" width="100%" height="550px"></iframe>


Hopefully I didn't make any mistakes. There's a bunch more stuff you need to remove: useless javascript, HEAD and BODY in the middle of another BODY... Maybe try the validator and clean it up, but I expect it will be dauting... I think it might be better to start coding from scratch, because it's really messy.

This post has been edited by Effovex: Feb 2 2007, 03:06 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
feldoln
post Feb 2 2007, 07:11 PM
Post #7





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



the second html code you supply is the same as the one i use. where did you get the other script from?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Effovex
post Feb 3 2007, 03:36 PM
Post #8


Serious Coder
*****

Group: Members
Posts: 251
Joined: 6-January 07
From: Sherbrooke, Qc, Canada
Member No.: 1,477



I got it got it from the "broken page" you posted earlier. Maybe your host is doing something fancy to the page after you upload it? If it works on your computer, and the code I'm getting isn't the code you're writing, tampering by the server is a definite possibility.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
feldoln
post Feb 3 2007, 04:37 PM
Post #9





Group: Members
Posts: 8
Joined: 1-February 07
Member No.: 1,752



i checked again on the broken page and it seems to have changed... or i just missed it somehow lol.

anyway, i tried the code you suggested, but unfortunately, the pages still refuse to load inside the iframes, and load the whole page up still.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 11:19 AM