Advanced Topics


Expression Evaluation in Javascript. Example.
Interactive Quiz with error checking ... Simple Quiz
JavaScript Quiz Maker Prof. Allen's Quick Maker (v1.4)
Pop Up Definitions Example showing how to enable popup definitions (works on IE and Nav).
Cookies: The basis of cookies is to set a variable associated with the document: "document.cookie". Once this has been set, with variouis parameters, it can be re-read anytime the page is visited again. example

JavaScript code to set a cookie:

/* define cookie */
function setCookie (name, value) {
  var str;
  if (value != null)
    str = name + "=" + escape(value);
  var now = new Date();
  var nowplus1 = now.getTime() + (52*7*24*60*60*1000);
  now.setTime(nowplus1);
  str += ";expires="+now.toGMTString();
  document.cookie = str+";";
}

JavaScript code to get a cookie:

function getCookie(name) {
  var cookie = " " + document.cookie;
  var search = " " + name + "=";
  var setStr = null;
  var offset = 0;
  var end = 0;
  if (cookie.length > 0) {
    offset = cookie.indexOf(search);
    if (offset != -1) {
      offset += search.length;
      end = cookie.indexOf(";", offset)
      if (end == -1) {
        end = cookie.length;
      }
      setStr = unescape(cookie.substring(offset, end));
    }
  }
  return(setStr);
}


Other intersesting files:
  1. Test your modem connection rate
  2. Browser Info
  3. Referral Page
  4. IP Address
  5. Exhaustive Browser Check
  6. Browser Spy

A good JavaScript Reference can be found at devedge.netscape.com (although it was last updated two years ago, JavaScript hasn't changed much)