topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 12:47 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Aren't all _on_ events JavaScript?  (Read 4919 times)

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Aren't all _on_ events JavaScript?
« on: January 03, 2010, 05:28 PM »
Folk,

I have a client/student who swears she has seen on events, e.g., onBlur, onClick, onMouseOver, and the like, that are [X]HTML events, not JavaScript.

I keep telling her that they are all JavaScript and do not exist in any of the HTML iterations.

However, I have been unable, to date, to find any concrete statement to that effect.

Her argument is that if you don't have to enclose the event in script tags, it ain't JS.  Her favourite argument is adding the onLoad to the body HTML element.  I'd really like to find something to refute that concept.

Can any of you point me to some source that will unequivocally show her the truth of my assertions  :).  Or prove me wrong, for that matter :o.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #1 on: January 03, 2010, 10:35 PM »
im not sure of exactly how the terminology would be used, but my understanding is that all of these events trigger javascript.
the onLoad element for html body, is explicitly designed to run JAVASCRIPT -- that you dont have to specify that javascript in a <script> block is irrelevant, it's still executing a javascript statement.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #2 on: January 03, 2010, 11:11 PM »
That's my understanding as well ... but I cannot, for the life of me, find anything that just flat says it outright.  This gal is pretty good at learning & utilizing Web scripts, but she's convinced that some on events are built into HTML, and I've not been able to dissuade her of that notion.

I'm fearful that it will come back to bite her when someone comes along with a JS-disabled browser, or something like Firefox with the NoScript extension.  My thought is that if I can find some documentation to support that these events are strictly JS, then she'll be more amenable to adjusting some of her page scripts.

However, in not even you are aware of such docs, chances seem to border on slim to none  :(.  Guess the only viable alternative is to get her to disable JS in her browser, then visit her own pages, but I'm not certain even that will convince her  :-\.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #3 on: January 03, 2010, 11:18 PM »
get her to disable JS in her browser, then visit her own pages, but I'm not certain even that will convince her  undecided.

anyone designing web pages using such events needs to do this no matter what, so this shouldnt even be an issue -- she needs to try this.
the noscript addon for firefox is good for temporarily disabling javascript, etc.

and any page that requires javascript should display some warning to the user when their javascript is disabled.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #4 on: January 03, 2010, 11:28 PM »
That, sir, is the conundrum.  You know that.  I know that.  She don' know dat, and is extremely reluctant to be convinced, since she can use some JS events - e.g., onLoad, onBlur, onFocus - w/o script tags.  I've been loathe to try to force her, but think that's about the only option left, sans specific documentation.

 ;) This is actually more onerous in that I'm not getting paid for the training ... if she were paying for it, she'd be a lot more likely to attend my warnings  :P.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #5 on: January 03, 2010, 11:31 PM »
this is one of those things that is not really debatable.
it doesn't matter if those events are javascript or prayers sent up to heaven for god to read and execute in your browser,
the important question in this case is what happens when a person hits your site with javascript disabled.

that doesnt have to be an existential question -- just have her disable javascript in her browser and visit the page and find out.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #6 on: January 03, 2010, 11:46 PM »
I know, sir, I know.  The problem is convincing her.  She's a stickler for docs - if it's [relatively] printed, it's gospel.  What I will do is point her to this discussion - she's gonna believe a foreigner - someone she doesn't know personally - over something like this.  It's not a matter of best practices so much as a matter of someone else telling her the same thing I've been preaching.

Hearing it from me, she tends to think it's an old guy's set ways.  In particular, your last post will likely serve as a lightning rod.  I'll pay for this, of course ... but we'll likely survive it  :D.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #7 on: January 04, 2010, 04:16 AM »
First, it's not just JavaScript but any kind of script your browser supports - JS is the most common and it's probably a dumb idea to use anything else unless for very specific projects... but theoretically you could use any scripting language.

Second, she's probably confused because this is generally called DHTML - the acronym looks like it's just another form of HTML, while it specifically means mixing HTML with client-side scripting.

Third, the On* events are part of the HTML specs, yes... but what would they execute, apart from script code? She might want to look at official docs :)
- carpe noctem

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: Aren't all _on_ events JavaScript?
« Reply #8 on: January 04, 2010, 08:29 AM »
Thank you, sir, for that document reference.

For one thing, it has rubbed my nose in the fact that I've gotten sloppy in my definitions of various HTML/script elements, something I sorely needed.

More to the point, however, it should be ideal for Gina:  it's dry, it's factual, but mostly it's official <chortle />.  It will also clear up some of my aforementioned sloppy descriptions for her.

I think this will convince her that browsing her pages with a script-disabled browser really is a necessity, not just a training exercise of an old geek.