You are here: Re: writing for browser compatability « HTML « IT news, forums, messages
Re: writing for browser compatability

Posted by Adrienne Boswell on 02/25/07 18:10

Gazing into my crystal ball I observed "Thad" <tsobota@cox.net> writing
in news:TLgEh.25040$7d1.12661@newsfe12.phx:

> Uh oh...you say I can't use document.write? That's exactly what I
> got
> working. If not document.write as in the following example, what would
> you suggest?
>
> Example from my js page:
> document.write("<dl id=\"menu\">");
> document.write("<dt class = \"btn\"><a href=\"beverage.html\">Beverage
> Insulators</a></dt>");
>

Your example looks like you are using js for a menu - perhaps something
that gets included in all pages. Not a good idea. Why? Because a lot
of visitors (including the most important) do not have js available.

You're better off using something server side:

<!-- #include file="menu.inc' -->


This is what most of my pages look like under the hood (most ASP):
<% option explicit
thispage = "Page title"
thisurl = "thisurl.asp"
%>
<!--#include file="linkrel.asp"-->
</head>
<body>
<!--#include file="header_inc.asp"-->
<!--#include file="nav_inc.asp"-->
<div id="content">
</div>
<!--#include file="footer_inc.asp"-->

Linkrel includes the doc type declaration, the title element, external
stylesheet and js file and other elements that go in the head.
Header_inc may or may not include a static header logo, etc. Nav_inc is
navigation, and is done server side. Footer_inc includes the standard
copyright information and closes any db connections.

This "template" system makes it very easy for me to a) reuse code b)
debug VERY easily.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация