PDA

View Full Version : Tab Content Script



vvv7000
01-22-2006, 05:26 PM
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

I pasted the script exactly how it is on the site demo page just to see if it works. It appears fine, but when I click on one of the tabs, it loads to another page that says "this page cannot be found".

Twey
01-22-2006, 06:06 PM
Heffalumps.
You may wish to change the href= attributes on the links. However, it sounds as though the problem may be deeper than that. If you do so and the problem still isn't fixed, please link to your page or paste you code (in [code] tags, please).

vvv7000
01-23-2006, 03:00 PM
http://www.geocities.com/n84889//template.html

I changed the attribute for the "What's New" tab, but the page still reloads, that's the problem.

BTW, I'm not clear as to what I did wrong for posting a link to the script. I thought I posted it right at the top of the message as requested.:confused:

Twey
01-23-2006, 03:04 PM
Eh... wrong sticky, sorry. Edited.
You might want to make sure you have a correct DOM tree before using scripts.
Or any DOM tree, for that matter.
validator.w3.org/check?uri=http://www.geocities.com/n84889//template.html
I don't know if it's possible to entirely validate that page; GeoCities' scripts might mess it up. However, you need to do at least something right in your HTML.

jscheuer1
01-23-2006, 08:04 PM
It could be Geocities script conflicts. Try changing:


<li><a href="http://www.dynamicdrive.com" class="current" onClick="return expandcontent('sc1', this)">Dynamic Drive</a></li>

to:


<li><a href="http://www.dynamicdrive.com" class="current" onClick="expandcontent('sc1', this);return false;">Dynamic Drive</a></li>

or even to:


<li><a href="javascript:void(0);" class="current" onClick="expandcontent('sc1', this)">Dynamic Drive</a></li>

Twey
01-23-2006, 08:22 PM
No, expandcontent() always returns false. That isn't the problem; I checked. Though it's odd; that would seem to be the problem at first glance.

jscheuer1
01-23-2006, 08:58 PM
No, expandcontent() always returns false. That isn't the problem; I checked. Though it's odd; that would seem to be the problem at first glance.

How did you check? I mean, of course I know that the function is supposed to return false. My thinking is that since, it isn't doing that on Geocities and because, otherwise the rest of the script appears to work, just finding a different way to prevent page loading onclick may be the best that can be hoped for on Geocities.

vvv7000
01-23-2006, 09:14 PM
YEEEEEEEEEEEESSSSSSSSSSSSSSSSSS.

The 2nd one worked. Thanks so much.