sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Two JavaScript Points

    scheduled pinned locked moved Developers' Forum
    2 Posts 2 Posters 222 Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • M Offline
      MartinRinehart
      last edited by MartinRinehart

      1. Hereabouts I once said that window.event is the same as event in a browser, because window is the global object. That was almost right.

      This will get a cross-browser event:

      onSomeEvent( e ) {
      e = e || event;
      
      

      MSIE, and I don't have it pinned down yet, sometimes insists on the window. prefix. I've started to routinely include window. even though it looks pretty dumb.

      1. Pop Quiz!
      
      var arr = [1,2,3,4,5];
      for ( elem in arr ) { alert(elem); }
      
      

      What is the first elem?

      Dan, if you know the answer, please be a little slow to post it.

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      one-reply-to-this-post last-reply-time reply quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @martinrinehart said:

        Dan, if you know the answer, please be a little slow to post it.

        .. yuz callin' me Slow, cuz'n ?? πŸ˜›

        I'm not here much anymore.

        one-reply-to-this-post last-reply-time reply quote 0
        • 1 / 1
        • first-post
          last-post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement