display error caused by javascript in a server side include

I'm a newbie.
On the following page, http://www.cristorey.net/practice/practice.shtm, there is a space above my nave bar that messes up the site's display.  If you visit the page, it's quite clear what I'm talking about.  The nav bar is a server side include that utilizes javascript.  For some reason, when the nav bar existed not as an include, but as part of the page, it displayed correctly.  When I insert the nav bar from the library as a scrip object, it no longer displays correctly.  Clicking on any of the links in the dropdown menu should show you the correct display.

Many thanks.
g.r.
grkearneyAsked:
Who is Participating?
 
alexhoganConnect With a Mentor Commented:
You said that after you made the nav bar a library item that you got the white line?

Webwoman hit it on the head when she said you have multiple tags in your page that are causing you problems.  However I don't think that editing every file is necessary.

When you look in your library item insure that you don't have any html tags other than the ones used to create the table that contains the nav graphics.  If you have any body or head tags remove them.  Be careful though because you will then need to take the javascript that may be in that file and place it in the main template file under the rest of the Macromedia generated code.  Make sure that you are not duplicating any of the javascript.

Even better would be to create a seperate .js file and place the code in that.  You can do this from the new file menu.  Then you will need to link the template to this file.

If you clean those out and insure that you are not duplicating any tags or javascript code between the library item and the template you should be OK.

Then you can still use your templates and everything will update like you expect.
0
 
webwomanCommented:
I'm surprised it displays at all.
You have multiple body tags. You have the javascript called AND in the page - I'm assuming it's the same thing. It's also there numerous times, both on the page and as a script tag. I counted THREE calls to the SAME script without looking far, and another one that looks like it's the same thing in another folder (or maybe the same folder, I don't know your directory structure).

Clean up the code.  
0
 
Ryan ChongCommented:
>>404 Object Not Found
Can try re-upload the file again?

regards
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
grkearneyAuthor Commented:
Ryancys:
It's back up.  Sorry I was working on it.  Webwoman, not sure I understand everything you're saying.  I bounced around in the code for a long time tonight.  Tried to clean things up.  Here's exactly what I am doing.  I built the pop-up menu in Fireworks.  I am inserting the fireworks object on an html page that is my server side include.  Then I am trying to call the include file in a template.  The page you guys are looking at, practice.shtm is derived from a template.  99% of what I do us WYSIWYG.  I have a hard time manipulating the code or knowing exactly what to do with it.  I've used includes before to accomplish the same end, but haven't experienced these spacing problems.  If you can give me some sense of how to clean up the code, I'd appreciate it.  More importantly, though, if you can help me get the page to display properly, I'd appreciate it.  THe pop-up menus, despite problems that may exist in the code, work fine.  You can actually use them to get to pages that aren't currently utilizing the ssis.  

I'm grateful for your help, and especially grateful if you can dumb down your comments for this newbie.  Many thanks.
gr
0
 
Ryan ChongCommented:
What if you cut and move the Javascripts below to the place just after "<Body>" tag? I think that may cause the line problem?

<script language="JavaScript">
<!--
function mmLoadMenus() {
  if (window.mm_menu_0801142101_0) return;
...
..

//-->
</script>
<script language="JavaScript1.2" src="../Library/mm_menu.js"></script>
<script language="JavaScript1.2">mmLoadMenus();</script>

Also, try to set the td height to 1 or remove it, try don't set it as 69 .. like:

<td height="69" align="left" valign="top"><img src="/assets/hdr_about_cristo_rey.gif" width="750" height="69"></td>

to:

<td height="1" align="left" valign="top"><img src="/assets/hdr_about_cristo_rey.gif" width="750" height="69"></td>

regards
0
 
Ryan ChongCommented:
oh, of course, edit it from your template file (it's a good habit always backup you files before you start amend it ;-)
0
 
grkearneyAuthor Commented:
Ryan:
Here's the deal.  When I edit in the template, the template doesn't show all the javascript code.  It just shows one line saying that it will include the server side include.  I can move the code on the include file, but there there's really nowwhere to put i, because to create the insertable file you've got to remove the document head and all that information.  With all that said, if you go to the page now, the javascript code for the menus is beneath the body tag.  I also set the cell heights for the banner and for the nav bar to 1.  But none of it works.  I still have the white line.  I also went in to dreamweaver and edited my preferences so that it doesn't show the icon for the script.  That didn't change anything.  I have no idea what to do next. Do you have any ideas?  Thanks for your help.

Take care,
george
0
 
webwomanCommented:
You need to DIRECTLY EDIT THE CODE. And a template is NOT the way to do it.
0
 
grkearneyAuthor Commented:
webwoman:
THe site has hundreds of pages.  It seems tedious to have to edit the code on all of them.  I can edit the code on in the template.  If I get it right there, it will be right everywhere else, right?  Except the fact for the fact that i generated the javascript code from Fireworks.  So, how do I do it?  Your above suggestion doesn't tell me too much.
0
 
Ryan ChongCommented:
Just an idea, try set the table/tr/td background images to same as your header picture? So that it will cover the white line.. just guess it will works..
0
 
webwomanCommented:
First, get rid of any extraneous stuff in the javascript.
Second, make sure the template code is clean -- squeaky, 99/100% clean. Do it IN CODE. DO NOT use DW, it won't let you edit where you need to edit. You need to edit all the junk that's been put in by FW.

And you WILL have to edit EVERY SINGLE PAGE. That's the ONLY way you're going to make this work right.

Does your server support any server side scripting? That's really the way to do this. If you want to cut down on maintenance in the future, you're going to have to invest a large chunk of time now. I suspect that with some serious rethinking of how the site is constructed, you could get that 'hundreds of pages' down A LOT.
0
 
grkearneyAuthor Commented:
Alex:

THanks.  I think I figured it out... thanks in part to your suggestions and those of webwoman.  You were right.  I didn't have to edit every singe page, but did have to clean up the code.  I then encountered another problem where the include file wasn't displaying on pages in subdirectories.  Buit moving the include file into the same directory with the images that made up the include solved that.  

I have one last little question, though.  THe point of setting up the includes has been to get the folks who will manage content for the website at the school to be able to update more easily without relying on making changes in templates that are applied to many many pages.  Now they'll just be able to make changes to the include files and the changes will then be reflected sitewide.  They'll use fireworks to edit the pop-up menus.  At least this is my plan... so, with that as a goal, does it still make sense to create the external .js file.  That, in all likelihood, would be more difficult for them to edit.  I don't know too much, and they know a lot less than me.

Thanks,
george
0
 
alexhoganCommented:
I think it is always best to take a compartmentalized or modular approach.  Whether it's a dynamic or a static site.  That way if you have a global change you reference it in a single place.

If you are going to have many people responsible for the updating of a site then I would suggest converting to a dynamic architecture.  That will allow the greatest amount of people with a generalized skill set to make content changes, additions or modifications.

If they are just going to be updating pop-up menus along with the content then I would still suggest an external file.  What you will be changing isn't directly graphic related is it?  If it's just navigation and menu items then you can change them in FW and note the changes in the script produced and place it in the external file.

It's a little extra work, but it will insure integrity.
0
 
grkearneyAuthor Commented:
okay, so, to create the external file, just file new, in dreamweaver, and choose a javascript file.  Then copy the code that fireworks generates.  Then, in the template file, link to the external file.  What about the graphics.  Are they folded into the javascript.  Or do I still insert them?  Right now, I just insert the library item.  That included the javascript code and the graphics.  

thanks.  last question and I'll leave you alone.
0
 
alexhoganCommented:
[snip]
okay, so, to create the external file, just file new, in dreamweaver, and choose a javascript file.  Then copy the code that fireworks generates.  Then, in the template file, link to the external file.
[/snip]

Yes

[snip]
What about the graphics.  Are they folded into the javascript.  Or do I still insert them?
[/snip]

The graphics are part of the page.  The javascript will preload and swap the graphics and give you the navigational functionality.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.