Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About CalBear

  • Rank

Profile Information

  • Location
  1. Thank you, that does the job! I really appreciate the fast and useful answers on this forum.
  2. These work: (sorry about the lack of indents, result of copy/paste) //set up event handlers//change background color on element mouseoverfor(i = 0; i < numTop; i++){ for(n = 0; n < numItems; n++){ items[n].onmouseover = function(){ this.style.backgroundColor = "#CCCCCC"; } items[n].onmouseout = function(){ this.style.backgroundColor = "#FFFF00"; } } //change visibility on element mouseover drop.onmouseover = function(){ this.style.visibility = "visible"; } drop.onmouseout = function(){ this.style.visibility = "hidden"; }} And these work: menu[0].onmouseover = function(){
  3. I've never had validation problems with embedded JavaScript. Example... this validates (sorry about the formatting, it lost something in the cut/paste) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Knock Knock Joke</title></head><body><script type="text/javascript">//Begin the first jokeresponse = window.prompt("Knock Knock!", "Who is there?");//Analyze the player's
  4. I've been designing and maintaining small websites for non-profit organizations for about 6 years. The doctypes range from HTML 4.01 Transitional to XHTML1.1. I thought I was "doing the right thing" by going to XHTML and making sure all web pages passed the W3C validation test. But now I read that XHTML was a branch in a different direction and HTML5 is the way things will go in the future. I realize that HTML5 is not cooked yet however, it is a super-set of HTML 4.01. Should I abandon XHTML and go to HTML5 while staying away from features that are not supported by older browsers? It nicely re
  5. Thanks for the reply. Yes, I realize that XMLHttpRequest is a problem prior to IE7. I hadn't thought about the original installations of XP being IE6. My websites (non-profit organizations) do get occasional hits from IE6, generally much less than 1%. So I'll not worry about language and hiding but keep in mind the need to take care of XMLHttpRequest if I do a website where IE6 may be important.
  6. How important is to code for old browser compatibility? I have experimented with eliminating the following and found no problems with IE7+ (IE version 7 introduced in 2006), all versions of Firefox, Safari, and Chrome. 1) language = "javascript" 2) All the code relating to XMLHttpRequest just use Request = new XMLHttpRequest() for all browsers tested. 3) <!-- Start hiding JavaScript statements // End hiding JavaScript statements --> There may be some more sophisticated JavaScript code examples that do need some special browser compatibility coding. I would be interested to know what th
  7. That sounds reasonable. However, I don't understand why most tutorials/books "teach" var myArray = new Array(); yet the two code checkers absolutely insist you use [ ].
  8. JShint.com and JSlint.com say that an array should be declared as var myArray = []; not as var myArray = new Array(); which is shown on most web resources and published books. What is correct and why?
  • Create New...