Click to See Complete Forum and Search --> : SSI works on each page but not when linked


moondance
11-21-2003, 03:59 AM
I have used a global stylesheet, included as:

<link rel="stylesheet" href = "includes/mystyle.css" type = "text/css">

I also have two SSI's, that are used to hold the javascript and div/ table structure for a drop down menu, so i can include the menu in every page without having to rewrite it- these are added as:

<!--#include file="includes/jscript.shtm" -->
<!--#include file="includes/menu.shtm" -->

I have this code on every page.

Whenever i preview the page it works fine, the css, javascript and menu all show and work great. But when i click on the links in the table, it takes me to the page but the menu doesn't show.

If i start from the the page that menu didn't show on, the menu appears, but likewise, clicking on a link takes me to apge with no menu.

So the menu appears on each page individually, but not when using the links.

Does anyone know why this is, or offer advice on how to solve this?

96turnerri
11-21-2003, 06:24 AM
that might happen if the links a js writen, you havnt inlcuded the include command in the document.write function

moondance
11-21-2003, 06:27 AM
can you explain that a bit more i don't understand - your saying i need to use the include statement with document.write in my javascript for my menu ? how can i do that?

:confused:

96turnerri
11-21-2003, 07:45 AM
it might be that is that the only javascript bits you have on the page?

moondance
11-21-2003, 08:07 AM
still don't follow.

i put both the above includes into one include file to see if that would make a difference: it didn't, but at least its together now.

so now i only have the one include and yes it is does contain the only javascript on the page.

you were saying something before about document.write - well i've got these lines in the file:

<SCRIPT language="JavaScript"><!--

//browser stylesheets

if(f7_ie){
document.write('<style type="text/css"><!--')

document.write('.dropdown {height:1px; width:100px; padding-left:10px; padding-top:10px; padding-right:10px; padding-bottom:10px;}')
document.write('p { margin-top:0px; margin-bottom:6px }')
document.write('a { text-decoration: none }')
document.write('a:hover { color: white; text-decoration: underline }')
document.write('--></style>')
}

</SCRIPT>

is this relevant?

96turnerri
11-21-2003, 09:29 AM
why are you having that as an extrenal js file cant you just have

<link rel="stylesheet" href="FILENAME.css" type="text/css">

and save this as FILENAME.css

.dropdown {
height:1px;
width:100px;
padding-left:10px;
padding-top:10px;
padding-right:10px;
padding-bottom:10px;
}
p {
margin-top:0px;
margin-bottom:6px
}
a {
text-decoration: none
}
a:hover {
color: white;
text-decoration: underline
}

moondance
11-21-2003, 09:43 AM
i already have an external css file.
the external js file is for the javascript behaviours for the menu, some div tags (where the styles are defined in the external css file) and a table structure for my menu.

i've tried what you said: i deleted that code from the js file and defined it in the css file, but it still doesn't work - the menus won't appear when using the links.

:confused:

96turnerri
11-21-2003, 11:44 AM
do you a working url you could post then could see the entire site/pages?

moondance
11-24-2003, 03:57 AM
its offline at the moment, i can't upload it till i can show its working fine :mad:

i think i've found out whats causing the problem though. in the external javascript menu i've got a table structure that displays the menu.

In each td is a reference to javascript functions to show or hide the drop down layers. eg:

<table>
<tr>
<td>
<A href = "#" class="dropdown" onmouseover = "ShowDrop(0)" onmouseout = "HideDrop()" Menu 1</A></td>
</tr>

etc for each menu item.

If i remove this table structure and place in the code it WILL appear on every page, but the javascript doesn't work.

So i was wondering - is it possible to call the mouseover and mouseoff functions from an external javascript source eg:

<td>
<A href = "#" class="dropdown" onmouseover = "includes/js_menu/ShowDrop(0)" onmouseout = "includes/js_menu/HideDrop()" Menu 1</A></td>

something similar to that?

any help is appreciated.

96turnerri
11-24-2003, 11:00 AM
yes it is possible but your wont need includes/js_menu/ShowDrop(0) just ShowDrop(0) because the js file in the head will be read before the link so when click the link it will refer to the js script

moondance
11-25-2003, 04:03 AM
thats exactly what i thought but that doesn't seem to be it.

something weird i've just discovered - if i open the page in dreamweaver, then preview it in a broswer (f12), the menu shows up on the page, but if i open the page by double clicking the icon in the folder, the same page appears with no menu.

Do you think this might have something to do with why only the first page will show a menu?

I was going to upload a sample, if anyone would mind taking a look at it i'd greatly apprectiate it.

moondance
11-25-2003, 04:23 AM
heres the sample if anyones got ANY suggestions.

The two pages i'm testing on (page1.html & page 2.html) are from the submenus under heading 1 - submenu 1 (page1) and submenu 2 (page2).

you might have to open them in dreamweaver to see the ssi - read the above post.


cheers

moondance
11-25-2003, 07:03 AM
does it matter if in the shtml file theres <javascript> </script> tags ?

I've read you can't have <html> or <body> or <head> so maybe thats something to do with it?