Can this html be wrapped up in a style sheet?

windows

Guest
Can the html below be wrapped up in a style sheet so it can be called remotely rather than having to reside on the actual page??? There will be two other scripts called along with the style sheet.

Sorry, rank beginner here...

-steve-

<div id="point1" STYLE="position:absolute;visibility:visible;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript: MM_openBrWindow('http://www.mysite.com','','top=5,left=5,width=535,height=560,resizable=yes,scrollbars=yes')">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.mysite.com/myImage.gif" width=96 height=60 alt="" border="0">
</a>
</td>
</tr>
<tr>
<td>
<p align="center"><a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript: MM_openBrWindow('http://www.mysite.com/more.html','','top=5,left=5,width=535,height=560,resizable=yes,scrollbars=yes')"><font face="Arial" size="2" color="#0000FF">More
Info</font></a></p>
</td>
</tr>
<tr>
<td>
<center><a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript: MM_openBrWindow('http://www.mysite.com/new.html','','top=5,left=5,width=535,height=560,resizable=yes,scrollbars=yes')">
<font face="Arial" size="2" color="#0000FF">What's New</font>
</a></center>
</td>
</tr>
</table>
</div>No, external stylesheets may contain only CSS. If you wish to include bits of code from one file into many (say, navigation, to keep from having to update many files), then you need a server-side language, such as PHP or ASP. Alternately, you could use SSI (Server Side Includes) (<!-- m --><a class="postlink" href="http://www.google.com/search?hl=en&ie=UTF-8&q=Server+Side+Includes&spell=1">http://www.google.com/search?hl=en&ie=U ... es&spell=1</a><!-- m -->) if your host supports it.Originally posted by Paul Jr
No, external stylesheets may contain only CSS. If you wish to include bits of code from one file into many (say, navigation, to keep from having to update many files), then you need a server-side language, such as PHP or ASP. Alternately, you could use SSI (Server Side Includes) (<!-- m --><a class="postlink" href="http://www.google.com/search?hl=en&ie=UTF-8&q=Server+Side+Includes&spell=1">http://www.google.com/search?hl=en&ie=U ... es&spell=1</a><!-- m -->) if your host supports it.

dont u need to use a server-side language in order to do SSIs?You can also do this in javascript.

You can convert the html to js with this handy tool : html to js (<!-- m --><a class="postlink" href="http://www.cis.nctu.edu.tw/~is84034/works/mclee_tools/html2js.php">http://www.cis.nctu.edu.tw/~is84034/wor ... tml2js.php</a><!-- m -->).

If you save that into a .js file you can call it up wherever you like.

Maybe you save it to nav.js, then just include this :<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"nav.js"></script>
into your page where you want it.

There are other ways to do this - as mentioned above - but this is fairly simple too.BonRouge - thank you - the tool you posted may just do the trick...

-steve-:cool:Originally posted by BonRouge
You can also do this in javascript.

You can convert the html to js with this handy tool : html to js (<!-- m --><a class="postlink" href="http://www.cis.nctu.edu.tw/~is84034/works/mclee_tools/html2js.php">http://www.cis.nctu.edu.tw/~is84034/wor ... tml2js.php</a><!-- m -->).

If you save that into a .js file you can call it up wherever you like.

Maybe you save it to nav.js, then just include this :<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"nav.js"></script>
into your page where you want it.

There are other ways to do this - as mentioned above - but this is fairly simple too.

Although this method will cause chunks of the page to vanish completely for anyone with Javascript disabled or that has certain settings on their firewall.Originally posted by pawky
dont u need to use a server-side language in order to do SSIs?
Not that I am aware of. SSI and server-side languages are different technologies. Some hosts do not support any server-side languages, but do support SSI.You can do SSI with SHTML, PHP, or ASP(.net), (as well as others, possibly). SHTML is SSI, but isn't done with a SSL.Originally posted by Ben R.
You can do SSI with SHTML, PHP, or ASP(.net), (as well as others, possibly). SHTML is SSI, but isn't done with a SSL.

wow, lol that's a mouth full ;P so what exactly is shtml? i think its time for me to do more readin on SSIs then ;P I thik ill start w/ the google search paul provided. thx :)I'm wondering why people disable javascript...
Do people actually decide, "No! Out damn javascript!" and switch it off?Originally posted by BonRouge
I'm wondering why people disable javascript...
Do people actually decide, "No! Out damn javascript!" and switch it off? Some people don't "disable" it. Some people don't have it to begin with, period. Such users could be disabled persons where there browsers simply don't support JavaScript. Others, however, who are stuck using poorly done pieces of software such as IE, use it as a method of defense.

Basically, if you care at all about accessibility, you wouldn't use the script you provided. Creating an inaccessible page is not only ethically wrong, but in fact illegal under some circumstances.

Please read the following from the W3C's Web Content Accessibility Guidelines. Take a look at Priority 1 (read: it isn't optional).From <http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-scripts>:
6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page.So yeah... Thanks for that.

I'll start making changes (some of my menus are in Javascript files).

I haven't really tried SSI (well, I tried it after reading this thread to see how it worked). It seems that my page has to be shtml - is it OK for an index page to be shtml? (Or is that a stupid question?)

Could you have a look here (<!-- m --><a class="postlink" href="http://resources.cheers-sendai.com/">http://resources.cheers-sendai.com/</a><!-- m -->) and tell me if this menu seems OK? The menu on the left (if you have javascript enabled) is javascript (obviously) but underneath it there's a link to a full page html menu.

Thanks again.

SteveNo problem.

Yes, the default file extension associated with SSI seems to be .shtml, however you can change that to be just about anything.

As for your menu, that's a little better, as it at the very least degrades properly for non-JavaScript users. However, I'd strongly suggest using something such as this CSS-based navigation (<!-- m --><a class="postlink" href="http://www.vladdy.net/Demos/CSSNav.html">http://www.vladdy.net/Demos/CSSNav.html</a><!-- m -->) for an even more accessible alternative.
 
Back
Top