Lessons learned in creating this web site

Domain Names and ISPs

  1. I found one site that supported FrontPage and ASP that was much cheaper than the others (£35/year). www.ace-internet.co.uk.  The free ones tend to put banners everywhere, even on margins and headers - makes a framed page impossible.  This site has now proved unreliable - try www.tollon.co.uk.

  2. It costs me £5/year to register a .org.uk domain name from www.easily.co.uk.  However I transferred the name for free to the above ISP and their charges would have been less!  Although easily offer a "framed" method of showing only your fancy domain name in the top browser URL box, your actual URL is shown below in the status box for hyperlinks.  Ace-internet were able to make that read sensibly too, although this does cost another £25.

  3. Free web sites just don't offer you any features other than static web pages, beyond a counter and a guest book

FrontPage

  1. Microsoft Front Page, which is only supported by a few ISPs (who generally charge £100+/year) does do more including databases but it is quite limited in the specific way it implements things allowing little freedom.

  2. I chose to use Front Page to start with as it is WYSIWYG and very easy to upload and amend on the fly, but decided to do the database bit in code using Active Server Page (ASP) technology.

  3. I chose Front Page because i) I had it ii) it does do WYSIWIG stuff and supports raw HTML and scripting but mainly because it allows you to upload much more easily than FTPing and you can actually edit your web page directly in seconds and see if things work.

  4. Front Page has some funny ways to implementing things that cannot be by VBScript for security reasons.  It uses Webbots, which seem to generate javascript automatically when the page is read by the ultimate user!

  5. Whether the server runs on NT or UNIX is amazingly important as any server side software must run on these machines.  It is surprising to note that Microsoft Front Page does not support its own user registration on its own NT machines as passwords cannot be allocated remotely, so one has to write one's own code to do this oneself.  UNIX is terribly concerned about case, NT is nice and easy!

SQL

  1. Don't use an SQL search for a hash (#) character - it just misses it!

Robots

  1. To stop ejunk robots from discovering my email, I have encoded it as &nn; characters and with dynamic javascript.

  2. Promoting a web site can be improved with a "doorway page", one written just for robots!  Just enough repetitions and lots of keywords and a link to your mane page. Search engines (eg Google) have trouble with frame pages.  It is important that the <no frames> tag has more than FrontPage puts in, because Google gives "Sorry but you page does not support frames" as a description!  Change this and put a good description of your site.  Also put in hyperlinks (which are invisible) to your other pages such as the contents margin and main ones.  Then you must put in the javascript:"if (top == self) self.location.href = "default.asp"; in these pages to put them back into your frames page, just in case someone gets sent by a search engine directly to them.  Alternatively one produces a link, this way the visitor can see that he found what he searched for.  Trouble is, that one could be in someone else's frame and the button would not appear, so one must also check to see if top.location.href is you domain name.

Cookies

  1. Oh dear IE6 does block third party cookies.  I tried using a compact policy in the HTTP headers but to no avail.  The solution is the open up a new browser window if you wish to send data to another site and have it store cookies (eg transferring registration data to the mirror site).

  2. JavaScript uses the URL line of the browser to work out the name of a cookie (eg frames set this), ASP, however, uses what flashes below in the status window, which may be different when using frames.  There is no problem is web server you are using sets up so that your domain name appears everywhere.  If, however, you use another company as a web name provider and they provide a frame for you, then you will have problems.

  3. If cookies are not allowed, then session variables do not work!

  4. Web pages are static.  There are few ways of communicating between them.  A form can communicate from a client web page to the referred page, when the server loads it.  Cookies can be used.  Session variables are like basic global variables and work well.

ASP

  1. ASP can be implemented on a number of languages but VBScript is by far the easiest

  2. You can only write to files that are in a special area agreed by your ISP, usually at a level one higher than your root and only by scripting or ftp, ie not Frontpage

  3. You never see ASP code as its processed and stripped off at the server.

  4. Cookies can't be saved unless you stop a web page being send in bits and force it to wait until its all complete by setting <%response.buffer=true%>

  5. ASP allows spreadsheets to be used as databases.  Nice and easy!  However the driver has to learn what type to expect in each column.  It trains itself over the first 10 records, so if any are not filled in it gets confused.  This is solved by putting in dummy date in the first 10 records!

  6. Web pages are static.  There are few ways of communicating between them.  A form can communicate from a client web page to the referred page, when the server loads it.  Cookies can be used.  Session variables are like basic global variables and work well.

  7. If cookies are not allowed, then session variables do not work!

  8. If you don't rename a web page with an .asp extension, then the server script is ignored!

  9. If you are manually creating a get parameter after a URL, ensure it is URL encoded using the ASP "server object" or JavaScript "escape" function.  Also remember not to URL encode the first part of the line, ie display.asp?parameter=.  You must URL encode the data value only.  If you don't Explorer often works, Netscape never works!

  10. The VBScript random function rnd sort of works without the brackets , ie use rnd, not end(), but it finds loops of number to repeat around after 30 numbers!

  11. Passing data from JavaScript to ASP is requires constructing a hyperlink out of JavaScript and manually putting on the "?parameter1=¶meter2=etc", or even better using a hidden element of a form.  Remember to URL encode it or Netscape will complain!

  12. I got the error 'ASP 0115'.  It would appear that this is a Microsoft "feature" and not my fault!

  13. Caching really mucks up slightly altered forms and records being displayed properly.  In order to ensure a page is fresh as a daisy, include <meta http-equiv-"Expires" content="Tue, 24 Oct 17:45:00 GMT"> or some other old date is supposed to work but did not.  However using <%response.expires=-1500%> did work.  www.HTMLGoodies.com recommends all these every time:<%Response.CacheControl = "no-cache"%> and <%Response.AddHeader "Pragma","no-cache"%> and <%response.expires=-1%>!  I don't recommend the -1 as a slight synchronisation error between clocks could result in it not working.

  14. Beware that ASP does not determine the browser correctly for new browsers (eg IE6 is determined as Netscape.  Best to use JavaScript as it is native to the new browser.

  15. Beware JavaScript and ASP VBScript getting confused between (variable+1), ie variable1 and the numeric version incremented by 1.  Use parentheses!

  16. Checking that a cookie=1, works, even if it might not exist, but if it="" then there are type mismatch problems.  Always use "1".

  17. Beware string comparisons when one is Null, the output is not true or false but null.  The symptoms are like it just gets it wrong.  Rather than IF  ="", use IF <>"" then the null results in the correct selection.

  18. You can read an element of a session array using session("fred")(a) but cannot write to it, you must write to the whole of it.

HTML

  1. If you try displaying some variables in a table, eg a user search word and it happens to look like an unknown HTML tag, eg <start>, then it will not be printed!

  2. GIF format is better for pictures with few colours and allows one colour to be replaced by whatever the background colour is, ie it looks like the background shines through transparent bits.  Jpg give far more compression, but beware nice gentle gradients, eg skies.

  3. That damn   seems to have to be put into every empty table or one with ASP in it otherwise the inner borders are not drawn.

  4. Beware trying to use fonts on forms for Netscape Navigator.  For some reason, it ignores the command when calculating the width and text areas can be much wider than they should be.  Close down with </font>, but beware that FrontPage's themes play merry hell with this - so best to switch them off and do things manually.

  5. IE4 produces a spare line after a form unless you set margin-bottom to 0.  Netscape does not produce a spare line until you set margin-bottom to 0!  Use [if (document.singleform4.style!="undefined") document.singleform4.style.marginBottom=0] to get round this.

  6. A <div> inside a table creates inner top and bottom margins with Netscape 6 but not Explorer 6

  7. IE5 gives a JavaScript error with onlick=" fred();" because of the leading space in the parentheses

  8. In Netscape 4.7, if you do not specify the source of a frame in the frame file, then you cannot load one up later!

Style Sheets

  1. In style sheets, netscape 6 ignores colour numbers in quotes.

  2. Style ='background:yellow' overrides <body bgcolor='yellow'>

  3. Netscape 6 seems to ignore numerical class names.

  4. color:gray works and so does color:lightgrey.  Notice the spelling!

  5. Netscape 4 forgets CSS when you resize a window.  This can be fixed, by saving the window size using innerWidth and innerHeight, use onresize=reloadPage and get this function to test if the page has really changed using innerWidth and innerHeight and then location.reload() if necessary.

  6. Explorer adds two style commands together, Netscape just ignores the second one.

  7. CSS border control does not work well with tables in NN4, however place it in a div outside and it works well.

  8. IE4/5/6 place the border in the <body> outside the margin - even outside the scrollbars!  NN6 gets it right, ie padding then border then margin. NN4 just ignores the border.

  9. To remove margins in NN4, must use <body marginheight="0" marginwidth="0"> as well as the normal CSS margin control

  10. To create a table border in NN4, do not use a border around the table in CSS, but put the CSS in a div cannister around the table.

  11. IE6 font size is not inherited by tables, but font and color is!  NN6 works a treat!

  12. NN4 tables inherit nothing. One has to declare these in a separate td (not table) CSS tag.

  13. NN4 <P> and headings do not inherit after a table, but do before!

  14. NN4 body CSS text size does get inherited by headings!

  15. Whilst NN4 can display the symbol font, NN6 and NN7 cannot! Rather than using the symbol font, one should use Unicode entities (eg &#n; where n can be quite large or &t; where t is a number of characters).  However NN4 only sort of works up to n=255 so forget maths symbols etc.  The only foolproof way is to use images - juck.

Javascript

  1. Passing data from JavaScript to ASP is requires constructing a hyperlink out of JavaScript and manually putting on the "?parameter1=¶meter2=etc", or even better using a hidden element of a form.  Remember to URL encode it or Netscape will complain!

  2. Communicating JavaScript from one page to another is easy in frames.  In the top frame that defines everything, just declare a variable, eg fred as an object, then in a subsidiary frame use top.fred.

  3. In order to stop others linking to you squeezing them in their frame, the following code will give you a new window: "if (window!=top){window.open("http://www.jiveoholic.org.uk","");history.go(-1);}"

  4. When using the substring(a,b) property in javascript, a is the first character of the substring (counting from 0) and b is one greater(!) than the last character of the substring.

  5. When you want random numbers in JavaScript and you find you should use random(), no one tells you that you should actually use Math.random() if you want it to work!

  6. To refer to a form, one can just use "form.element.value" in IE, but Netscape insists on document.form.element.value or window.document.form.element.value.

  7. Beware JavaScript and ASP VBScript getting confused between (variable+1), ie variable1 and the numeric version incremented by 1.  Use parentheses!

  8. Use <BODY onBlur="self.focus()"> to make a page stay on top or just self.focus() when you want.

  9. Button to go back to previous page is <form><input type="button" value="Return to previous page" onClick='window.history.back()' name="B3"></p></form>

  10. Button to close current window is <form><input type="button" value="Close this window" onClick='self.close()' name="B3"></p></form>.  Use top.close() if you are in a frame.

  11. Beware framed pages where javascript object in one page are referred to by another.  When the back button is clicked, the order of the pages may result in an error stating that an object is null.  Best to turn off the cache of the frames page.

  12. It is possible to change things when someone asks for a printout using <BODY onBeforePrint="document.body.style.display = 'none';"onAfterPrint="document.body.style.display = '';"> or <STYLE media="print">BODY {display:none}</STYLE>.

  13. The proper way (W3C )of changing items is using getByID, but old IE uses document.all and old Netscape document.layers. Netscape 6 does it properly and no other way!

  14. You can find out how far you have scrolled down with document.body.scrollTop (IE) and window.pageYOffset (Nav).

  15. When using onclick="somefunction()" to handle events in forms/hyperlinks, remember to use onlick="somefunction();return false;" if you do not wish the form to carry on the normal operation, eg call the hyperlink.  alternatively use onclick="return somefunction()" if the function actually returns true or false as part of its algorithm, ie you specify this in the function.

  16. Lots of ways of setting an image background: document.all('textcell-1').style.backgroundImage='url(heart.gif)'; document.getElementById('textcell-2').style.backgroundImage='url(heart.gif)'; document.all('textcell-3').background='heart.gif'; document.getElementById('text4').src='heart.gif'; Only the second works for netscape 6 and none for netscape 4. The latter does not seem to work at all....but it may on buttons rather than text boxes

  17. If you have openned a window (eg to get a file name) and want to return back a variable to the main one use window.opener.variable name or window.opener.locaton.href= etc to reload the calling window.

  18. Document.clear() does not work, but document.close() then document.open() then write something does, but even better just to load using location.href if you can.

  19. Netscape could not find my home page of www.jiveoholic.org.uk, when the main page was default.asp, but when I added index.asp, it could.  I initially redirected using location.href="default.asp", but found that the back button would not work, but refreshed the site.  use of document.location.replace("default.asp") did the trick nicely.

  20. How to disable the back button! When in a frame, increment a variable in the permanent header frame.  The header has buttons and loads different main frames.  Each time these are called, increment the counter and send it as "?count=" using the GET method.  Each page compares the received (possibly if cached) GET using ASP with the living value of count in the header.  If this does not tally, alert the user and history.go(1) to go back.

  21. If you wish to print a different frame, make that the focus and just print, ie parent.main.focus();
    parent.main.print().  Using window.print() as the second command works OK with IE but not NN6.