Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Question is start() reserved?

    Just a curiosity:

    It looks like IE (and IE only) treats start as a reserved or used word in constructions like:
    Code:
    <input type="whichever" onclick="start()">
    As it does not appear to be a reserved javascript word, I suspect IE takes it as an ActionScript method, even I might be wrong...

    Anyway, if so, I wonder why in a construction like:
    Code:
    <span onclick="start()">click</span>
    IE accepts now the name start for the called function. Why this lack of consistency?

    Any explanation?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #2
    New Coder
    Join Date
    May 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did it use to be available for a windows media? wasnt there a start() pause() stop() function for their objects? i might be crazy

    regards
    KOR OWNS ROMANIA
    and JAVASCRIPT FORUMS!

    regards
    Marcus

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Kor: It's because in ie, input elements have a property named start. When you write script inline in an event handler, the scope of that event handler will contain all the properties of the form control itself, outside that scope will be the form itself, I'm not sure but I believe the document may come next in the scope hierarchy, and the window object comes at the bottom of the scope chain. As such, a property name on the input element will shadow a function name on the window object.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • Users who have thanked liorean for this post:

    Kor (06-10-2008)

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Thanks, liorean! That makes sense.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •