[WSG] DOCTYPE prevents script processing in IE!

2007-10-08 Thread Simon Cockayne
Hi,

Adding DOCTYPE stops page functioning with IE!


The following HTML works (in QUIRKS) for both IE and
Firefox...alertING Key Pressed!...erm...when a key is pressed.

html  lang=en-US
head
title
Keypress testing.
/title
meta http-equiv=Content-Type 
content=text/html;charset=utf-8 

script type=text/javascript  
function handleKeyPress(evt) {
alert(Key pressed!)
}   
/script

/head

body onkeydown=handleKeyPress(event);
pPress a key!/p
/body
/html


However, adding...

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
http://www.w3.org/TR/html4/strict.dtd;

...before the HTML...makes the Firefox page valid AND it still works ok.

Whereas the IE page, though also now valid, but no alert appears upon key press!


What's the story?

Cheers,

Simon


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] DOCTYPE prevents script processing in IE!

2007-10-08 Thread James Jeffery
Im at college at the moment, i tryed it with and without the doctype and it
worked fine. They are using IE6, i cant test on IE7 until i get home.

If everything is valid i cant see there being a problem, but there obviously
it.

Regrads

James


On 10/8/07, Simon Cockayne [EMAIL PROTECTED] wrote:

 Hi,

 Adding DOCTYPE stops page functioning with IE!


 The following HTML works (in QUIRKS) for both IE and
 Firefox...alertING Key Pressed!...erm...when a key is pressed.

 html  lang=en-US
head
title
Keypress testing.
/title
meta http-equiv=Content-Type
 content=text/html;charset=utf-8 

script type=text/javascript  
function handleKeyPress(evt) {
alert(Key pressed!)
}
/script

/head

body onkeydown=handleKeyPress(event);
pPress a key!/p
/body
 /html


 However, adding...

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
 http://www.w3.org/TR/html4/strict.dtd;

 ...before the HTML...makes the Firefox page valid AND it still works ok.

 Whereas the IE page, though also now valid, but no alert appears upon key
 press!


 What's the story?

 Cheers,

 Simon


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] DOCTYPE prevents script processing in IE!

2007-10-08 Thread Patrick H. Lauke

Quoting Simon Cockayne [EMAIL PROTECTED]:


Adding DOCTYPE stops page functioning with IE!


Works fine for me (IE7 and IE6) with and without DOCTYPE. Are you  
running it locally, and if so did you ignore the IE warning about  
scripting/activeX ?


P
--
Patrick H. Lauke
__
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__
Co-lead, Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__
Take it to the streets ... join the WaSP Street Team
http://streetteam.webstandards.org/
__



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] DOCTYPE prevents script processing in IE!

2007-10-08 Thread Christian Montoya
 On 10/8/07, Simon Cockayne [EMAIL PROTECTED] wrote:
  Hi,
 
  Adding DOCTYPE stops page functioning with IE!
 
 
  The following HTML works (in QUIRKS) for both IE and
  Firefox...alertING Key Pressed!...erm...when a key is pressed.
 
  html  lang=en-US
 head
 title
 Keypress testing.
 /title
 meta http-equiv=Content-Type
 content=text/html;charset=utf-8 
 
 script type=text/javascript  
 function handleKeyPress(evt) {
 alert(Key pressed!)
 }
 /script
 
 /head
 
 body onkeydown=handleKeyPress(event);
 pPress a key!/p
 /body
  /html
 
 
  However, adding...
 
  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
   http://www.w3.org/TR/html4/strict.dtd;
 
  ...before the HTML...makes the Firefox page valid AND it still works ok.
 
  Whereas the IE page, though also now valid, but no alert appears upon key
 press!

Does it matter whether you return true or false? Because every example
I've seen returns something, but you don't return anything.

-- 
--
Christian Montoya
christianmontoya.net


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***