Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. attachEvent method in Javascript

attachEvent method in Javascript

Scheduled Pinned Locked Moved ASP.NET
javascriptdebugginghelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bino B
    wrote on last edited by
    #1

    Hi everyone i've one WYSIWYG editor that im using in my classic ASP application. Im quite really unhappy with this control bcoz its not working in Mozilla and fine in IE.When i debug thru the code i found that these guys are using funny obscure document.all everyehere.I replaced it with getElementById and then i found insertAdjacentHTML which again is fixed using another workaround.But now im stuck up in attachEvent. Im not really getting any idea how to solve this.Please show me a way. You can find my control in the forum section in www.codepal.co.nr.

    Cheers Bino www.codepal.co.nr

    N 1 Reply Last reply
    0
    • B Bino B

      Hi everyone i've one WYSIWYG editor that im using in my classic ASP application. Im quite really unhappy with this control bcoz its not working in Mozilla and fine in IE.When i debug thru the code i found that these guys are using funny obscure document.all everyehere.I replaced it with getElementById and then i found insertAdjacentHTML which again is fixed using another workaround.But now im stuck up in attachEvent. Im not really getting any idea how to solve this.Please show me a way. You can find my control in the forum section in www.codepal.co.nr.

      Cheers Bino www.codepal.co.nr

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Sean Archer wrote:

      But now im stuck up in attachEvent

      attachEvent is a proprietary method for IE. For Netscape/Firefox use addEventListener instead hope this helps


      My Website | Ask smart questions

      B 1 Reply Last reply
      0
      • N N a v a n e e t h

        Sean Archer wrote:

        But now im stuck up in attachEvent

        attachEvent is a proprietary method for IE. For Netscape/Firefox use addEventListener instead hope this helps


        My Website | Ask smart questions

        B Offline
        B Offline
        Bino B
        wrote on last edited by
        #3

        no,its not working

        Cheers Bino www.codepal.co.nr

        N 1 Reply Last reply
        0
        • B Bino B

          no,its not working

          Cheers Bino www.codepal.co.nr

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Bino B wrote:

          no,its not working

          See the below sample

          var Browser = navigator.appName;
          if ( Browser != "Netscape" )
          {
          //Attaching events for IE
          YourObject.attachEvent('onkeypress', editorEvents);
          }
          else
          {
          YourObject.addEventListener('keypress', editorEvents, true);
          }

          here editorEvents is the method which handles the events.


          My Website | Ask smart questions

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups