Jump to content

Search the Community

Showing results for tags 'normalization'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Most JavaScript frameworks I've looked at that deal with input events (like jQuery) normalize events by checking for the presence of various properties when the event is received. It seems though it should be possible to determine in advance what properties to use by using event creation, e.g. (exception logging omitted for brevity): var mouseButtonPropertyToUse = "button";var event = null;if (typeof MouseEvent === "function") { event = new MouseEvent("");} else { try { event = document.createEvent("MouseEvent"); } catch (exception) { try { event = document.createEvent("MouseEvents"); } catch (exception) { } }}if (event && "buttons" in event) { mouseButtonPropertyToUse = "buttons";} This seems like it would work, but I haven't seen it done this way in practice so I'm wondering if there are potential problems I'm overlooking. Is this a viable approach for event normalization?
×
×
  • Create New...