Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14642

Re: Can't get onmouseover to work

Message-ID <1432080.lZcZS6J4QZ@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2012-06-24 04:00 +0200
Subject Re: Can't get onmouseover to work
Newsgroups comp.lang.javascript
References <b6350f1a-96f5-4508-9ac7-c7b9c597600d@googlegroups.com> <skccu71librasdr1mmjlsp6posi577ed0o@hive.bjoern.hoehrmann.de>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


Bjoern Hoehrmann wrote:

> * dwarnold45@suddenlink.net wrote in comp.lang.javascript:
>>I'm on page 115 of Resig's Pro Javascript Techniques (2006) and I can't
>>get the following code to work. When the mouse hovers over the link,
>>nothing happens to the background color.
> 
>><!DOCTYPE html>
>><html>
>><head>
>><title>Pro Javascript -- Events</title>
>>
>><script>
>>window.onload = loaded;
>>
>>function loaded() {
>>document.getElementById('body').style.border="1px solid #000";
>>}
>>
>>var li = document.getElementsByTagName("li");
> 
> There are no <li> elements in the document when this code is executed.

Which again points out that this book belongs in the "Worst books on this 
topic" category.  Either it has the bad example verbatim, or it fails badly 
in teaching its dedicated reader how DOM scripting works.  Given that "valid 
HTML is simply a subset of XML" (probably the most ridiculous claim in this 
book, to be found on page 8), both are equally likely.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can't get onmouseover to work dwarnold45@suddenlink.net - 2012-06-23 14:07 -0700
  Re: Can't get onmouseover to work Bjoern Hoehrmann <bjoern@hoehrmann.de> - 2012-06-23 23:21 +0200
    Re: Can't get onmouseover to work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-06-24 04:00 +0200
  Re: Can't get onmouseover to work "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-23 21:52 +0000
  Re: Can't get onmouseover to work dwarnold45@suddenlink.net - 2012-06-23 17:35 -0700

csiph-web