#7 Allow Explicit event handlers (window.onload)

closed
nobody
None
1
2006-10-19
2006-08-03
Anonymous
No

Allow this code to not throw an error:

function window.onload()
{
// Do something useful
}

As it is now this gives the following error:

newdialog.js(52): SyntaxError: missing ( before formal
parameters
function window.onload()

Discussion

  • Matthias Miller

    Matthias Miller - 2006-08-03

    Logged In: YES
    user_id=1357599

    That is not valid JavaScript code. Even if JavaScript Lint
    would support it, none of the browsers would.

     
  • Matthias Miller

    Matthias Miller - 2006-08-03
    • status: open --> closed
     
  • Tobin Zerba

    Tobin Zerba - 2006-08-11

    Logged In: YES
    user_id=746832

    Not true, this is standard practice in IE (yes, not cross-
    platform, but what can you do).

    The code base I'm dealing with has lots of these. I'd like
    to use JSL, but this issue is preventing me right now. I
    could fix all these to use standard event attach syntax,
    but that's going to be a lot of work that we can't afford
    to do right now.

     
  • Matthias Miller

    Matthias Miller - 2006-08-15

    Logged In: YES
    user_id=1357599

    I was wrong. Re-opening because Internet Explorer does
    indeed support this!

     
  • Matthias Miller

    Matthias Miller - 2006-08-15
    • status: closed --> open
     
  • Matthias Miller

    Matthias Miller - 2006-09-20
    • priority: 5 --> 1
     
  • Matthias Miller

    Matthias Miller - 2006-09-20

    Logged In: YES
    user_id=1357599

    Lowering the priority of this job. I'd rather help write a
    conversion script instead of implementing features that are
    not part of the ECMAScript standard, despite support in
    Internet Explorer.

     
  • Matthias Miller

    Matthias Miller - 2006-10-19

    Logged In: YES
    user_id=1357599

    Fixed on the trunk (r81). This will be included in the next
    release.

     
  • Matthias Miller

    Matthias Miller - 2006-10-19
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks