Discussion:
Server Side Includes and Javascript
(too old to reply)
TSemmes
2006-05-24 21:15:14 UTC
Permalink
Can one safely include javascript in a server-side include (SSI) file? It seems
to work but don't know if it will create problems down the line. I am using a
roll-over navigation bar created and generated in Fireworks. It seems to
defeat the purpose of using SSI if you can't include the javascript since if
there was a change at some point to the navigation bar you would have to change
the javascript that went with it. And it is nice to keep all that extra coding
out of every file on the site. IS there an official word on this or some
process in creating a SSI file that could prevent any problems?

You can see the file I created using this at <a target=_blank
class=ftalternatingbarlinklarge
href="http://www.hopkinsandporter.com/test.shtml">http://www.hopkinsandporter.co
m/test.shtml</a>
Murray *ACE*
2006-05-24 21:27:43 UTC
Permalink
Post by TSemmes
Can one safely include javascript in a server-side include (SSI) file?
Yes, but it makes your parent page's derived code messy.
Post by TSemmes
I am using a
roll-over navigation bar created and generated in Fireworks.
This is a big mistake for so many reasons.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Post by TSemmes
Can one safely include javascript in a server-side include (SSI) file? It seems
to work but don't know if it will create problems down the line. I am using a
roll-over navigation bar created and generated in Fireworks. It seems to
defeat the purpose of using SSI if you can't include the javascript since if
there was a change at some point to the navigation bar you would have to change
the javascript that went with it. And it is nice to keep all that extra coding
out of every file on the site. IS there an official word on this or some
process in creating a SSI file that could prevent any problems?
You can see the file I created using this at <a target=_blank
class=ftalternatingbarlinklarge
href="http://www.hopkinsandporter.com/test.shtml">http://www.hopkinsandporter.co
m/test.shtml</a>
TSemmes
2006-05-25 13:15:07 UTC
Permalink
Murray
this leaves more questions.
First what is a parent page (the template file?) and what is messy about the
code?
Also why is a roll-over generated from Fireworks a problem?. IS there an
alternative? I tried using pure CSS and text links for the navigation bar
orginally but could not get the spacing and look I wanted so I used the "insert
button" tool in Fireworks the exported to HTML.

Tom
Murray *ACE*
2006-05-25 13:30:31 UTC
Permalink
When you are using includes, there are two kinds of files -

1. The parent page: the page receiving the included content; the page being
named '.shtml'; the page that provides the structure within which the
included content resides; the page containing the <!--#include directives.
2. The include files: the code fragments that are being included in the
parent page.
Post by TSemmes
and what is messy about the
code?
You have HTML and javascript all mixed together. It makes for a messy
looking page.
Post by TSemmes
Also why is a roll-over generated from Fireworks a problem?
I suppose I could have looked at the link you posted. I can see that what
you used is not a problem. However, you do have javascript in the body of
the page that should be in the head....
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Post by TSemmes
Murray
this leaves more questions.
First what is a parent page (the template file?) and what is messy about the
code?
Also why is a roll-over generated from Fireworks a problem?. IS there an
alternative? I tried using pure CSS and text links for the navigation bar
orginally but could not get the spacing and look I wanted so I used the "insert
button" tool in Fireworks the exported to HTML.
Tom
TSemmes
2006-05-25 14:12:43 UTC
Permalink
You have HTML and javascript all mixed together. It makes for a messy
looking page.
Isn't javascript meant to be combined with HTML? And messy in what way?
Visually the way the user sees it? or the way the coder sees it?
However, you do have javascript in the body of
the page that should be in the head....
That works. Thanks!
Murray *ACE*
2006-05-25 17:22:36 UTC
Permalink
Post by TSemmes
Isn't javascript meant to be combined with HTML?
Yes, but usually in the head of the page.
Post by TSemmes
And messy in what way?
Cluttered.
Post by TSemmes
Visually the way the user sees it? or the way the coder sees it?
The way the coder sees it.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Post by TSemmes
You have HTML and javascript all mixed together. It makes for a messy
looking page.
Isn't javascript meant to be combined with HTML? And messy in what way?
Visually the way the user sees it? or the way the coder sees it?
However, you do have javascript in the body of
the page that should be in the head....
That works. Thanks!
Loading...