[thelist] Using PWS offline

Simon Coggins ppxsjc1 at unix.ccc.nottingham.ac.uk
Thu Feb 8 13:45:43 CST 2001


Well I've been lurking on the digest for a while now, so I thought I'd
debut with this question/tip combo:

The Question:

I'm running Microsoft Personal Web Server on my Win98 box so I can
test PHP pages, but at present I cannot "see" the web directory (at
http://oemcomputer/) unless I have a live connection.

Since I dial up with a modem this is a bit of a bind - is it possible to
configure PWS to work without being online?

The Tip:

<tip type="JavaScript" author="Simon Coggins">

When using JavaScript, take a little time to see what happens if it
has been disabled. With a little thought it's often possible to get your
code to degrade gracefully for the JavaScriptually Challenged. Here's a
couple of examples:

1. If you use a JavaScript drop-down menu as a secondary navigation
tool, write the form using document.write in JavaScript:

document.write('<form><select name="navi" onChange="jump(this.form);">');
document.write('<option selected>Choose a section...</option>');
document.write('<option>Section 1</option>');
document.write('<option>Section 2</option>');
document.write('<option>Section 3</option>');
document.write('</select></form>');

That way, if your visitor has JavaScript disabled, they won't see a
pull-down box that they can't use. Remember you will need to escape single
quotes inside the document.write statements with backslashes.

2. If you use JavaScript to spawn pop-up windows, you can still imitate 
the effect using target="_blank", although you won't be able to control 
the new window's properties. For instance this code:

<a href="newpage.html" TARGET="_blank" 
onClick="newWin('newpage.html');return false;">Visit newpage.html</a>

could open newpage.html using a function called newWin when JavaScript is
enabled, but still open the link in a new window without JavaScript
on. The "return false;" part is important - without it you would open two
new windows!

</tip>







More information about the thelist mailing list