CSS & Web Design Forum  

Welcome to the CSS & Web Design Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
WM Media Banner

Supporters
Pos Software - POS hardware and Software to track, control and manage your inventory.
Web Templates - BoxedArt is the most reliable source for unlimited template downloads.

Directory Submission
WL Marketing - Your #1 source for building links

Go Back   CSS & Web Design Forum > Web Design > AJAX, Javascript & DOM
Reply
 
Thread Tools Search this Thread Display Modes
(#1)
Old
jacerhea
Guest
 
Default Easy question about onkeyup event - 03-25-2009, 09:45 PM

Hello. What is the most proper syntax for an onkeyup event in a text
input tag? The attributes below both work in IE, but I wanted to know
what is the most proper syntax to ensure cross browser/javascript
compatibility, etc.

onkeyup="process(this);"
onKeyUp="process(this)"


Thanks.
Reply With Quote
(#2)
Old
Evertjan.
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 10:16 PM

jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:

> Hello. What is the most proper syntax for an onkeyup event in a text
> input tag? The attributes below both work in IE, but I wanted to know
> what is the most proper syntax to ensure cross browser/javascript
> compatibility, etc.
>
> onkeyup="process(this);"
> onKeyUp="process(this)"


Why is this an easy question?

onkeyup is not javascript.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
(#3)
Old
SAM
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 10:23 PM

Le 3/25/09 10:42 PM, jacerhea a écrit :
> Hello. What is the most proper syntax for an onkeyup event in a text
> input tag? The attributes below both work in IE, but I wanted to know
> what is the most proper syntax to ensure cross browser/javascript
> compatibility, etc.
>
> onkeyup="process(this);"
> onKeyUp="process(this)"


HTML is not cas sensitive,
ONkEYuP will be so good as oNkEyUp

The best is to take use to write all in lowercase
(even tags, not only attributes)

for a compatibility with the XHTML

--
sm
Reply With Quote
(#4)
Old
SAM
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 10:23 PM

Le 3/25/09 11:07 PM, Evertjan. a écrit :
> jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:
>
>> Hello. What is the most proper syntax for an onkeyup event in a text
>> input tag? The attributes below both work in IE, but I wanted to know
>> what is the most proper syntax to ensure cross browser/javascript
>> compatibility, etc.
>>
>> onkeyup="process(this);"
>> onKeyUp="process(this)"

>
> Why is this an easy question?
>
> onkeyup is not javascript.


that's new ?

--
sm
Reply With Quote
(#5)
Old
Evertjan.
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 10:41 PM

SAM wrote on 25 mrt 2009 in comp.lang.javascript:

> Le 3/25/09 11:07 PM, Evertjan. a écrit :
>> jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:
>>
>>> Hello. What is the most proper syntax for an onkeyup event in a text
>>> input tag? The attributes below both work in IE, but I wanted to know
>>> what is the most proper syntax to ensure cross browser/javascript
>>> compatibility, etc.
>>>
>>> onkeyup="process(this);"
>>> onKeyUp="process(this)"

>>
>> Why is this an easy question?
>>
>> onkeyup is not javascript.

>
> that's new ?


So you expect only new answers?

It has nothing to do with javascript browser compatibility.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
(#6)
Old
jacerhea
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 11:02 PM

> HTML is not cas sensitive,
> ONkEYuP *will be so good as oNkEyUp
>
> The best is to take use to write all in lowercase
> (even tags, not only attributes)
>
> for a compatibility with the XHTML
>
> --
> sm



Thank you. What about the semi-colon at the end? Again it works
either way, but it seems like it should be there even though I usually
see other peoples code without it.



> Why is this an easy question?


Easier for some than others, I guess.
Reply With Quote
(#7)
Old
Evertjan.
Guest
 
Default Re: Easy question about onkeyup event - 03-25-2009, 11:55 PM

jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:

>> Why is this an easy question?

>
> Easier for some than others, I guess.


I did not put the Q.
The answer was easy.
But why say the Q is easy?
That does not make sense to me.

> What about the semi-colon at the end?


optional, unless you want two statements on one line/string

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
(#8)
Old
Trevor Lawrence
Guest
 
Default Re: Easy question about onkeyup event - 03-26-2009, 03:30 AM

"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns9BDA75F38358eejj99@194.109.133.242...
> jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:
>
>>> Why is this an easy question?

>>
>> Easier for some than others, I guess.

>
> I did not put the Q.
> The answer was easy.
> But why say the Q is easy?
> That does not make sense to me.
>
>> What about the semi-colon at the end?

>
> optional, unless you want two statements on one line/string
>



My original understanding was that the semicolon was a statement separator
which is not needed if statements are on separate lines. But I later read
(and came to understand) that semicolons are inserted by the browser where
needed. This was termed automatic semicolon insertion, or some phrase like
that.

So I thought that the correct syntax is to always use a semicolon, but if
you don't, then one will be inserted at the end of each line (where needed)

Am I way off course in this assessment?

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org


Reply With Quote
(#9)
Old
Evertjan.
Guest
 
Default Re: Easy question about onkeyup event - 03-26-2009, 09:56 AM

Trevor Lawrence wrote on 26 mrt 2009 in comp.lang.javascript:

>>> What about the semi-colon at the end?

>>
>> optional, unless you want two statements on one line/string
>>

>
>
> My original understanding was that the semicolon was a statement
> separator which is not needed if statements are on separate lines. But
> I later read (and came to understand) that semicolons are inserted by
> the browser where needed. This was termed automatic semicolon
> insertion, or some phrase like that.
>
> So I thought that the correct syntax is to always use a semicolon, but
> if you don't, then one will be inserted at the end of each line (where
> needed)
>
> Am I way off course in this assessment?


The browser does not do anything but send the script parts to the
interpreter.

The interpreter does not make a new script in the sense of a readable
string, but interpretes and executes.

There could be some intermediate code generated, but I trust that is not a
script.

depending on the make of the interpreter the statements are seen as
individuals and perhaps a dividing byte is inserted instead of a new line
or semicolon, or maybe they are seen as an array of statements, but all
that is internal.

My view only.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
(#10)
Old
Jorge
Guest
 
Default Re: Easy question about onkeyup event - 03-26-2009, 02:41 PM

On Mar 26, 10:51*am, "Evertjan." <exjxw.hannivo...@interxnl.net>
wrote:
> Trevor Lawrence wrote on 26 mrt 2009 in comp.lang.javascript:
>
>
>
>
>
> >>> What about the semi-colon at the end?

>
> >> optional, unless you want two statements on one line/string

>
> > My original understanding was that the semicolon was a statement
> > separator which is not needed if statements are on separate lines. But
> > I later read (and came to understand) *that semicolons are inserted by
> > the browser where needed. This was termed automatic semicolon
> > insertion, or some phrase like that.

>
> > So I thought that the correct syntax is to always use a semicolon, but
> > if you don't, then one will be inserted at the end of each line (where
> > needed)

>
> > Am I way off course in this assessment?

>
> The browser does not do anything but send the script parts to the
> interpreter.
>
> The interpreter does not make a new script in the sense of a readable
> string, but interpretes and executes.
>
> There could be some intermediate code generated, but I trust that is not a
> script.
>


The browser builds a function whose body is the quoted text, and
attaches it to the element as a handler for that kind of event.

<div onclick="alert(event+'\r'+arguments.callee)">CLICK ME</div>

Yields:

[object MouseEvent]
function onclick (event) {
alert(event+'\r'+arguments.callee);
}

--
Jorge.

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Hosting at Triple.com
vBulletin Skin developed by: vBStyles.com

Printing Company  Link Building Services