Questions tagged [attachevent]

44 questions
1
vote
0 answers

Methods for applying page specific javaScript externally

I appreciate that this will heavily depend on requirements, but I'm fairly new to attaching events to elements externally. I wanted to know of the best practice to identify page specific scripts and events and minimising the JS in the HTML…
andybarnes
  • 294
  • 1
  • 14
1
vote
0 answers

IE attachEvent call returns true, but handler shows "null"

I have a fairly simple ASP.NET page that renders an HTML input (text box). Within the generated HTML, I attach a handler to several events, including onfocus, onkeypress, and onkeyup. Because this is a solution targeted at a version of IE that does…
David W
  • 10,062
  • 34
  • 60
1
vote
0 answers

What is the best/standard addEventListener workaround for IE that handles memory leaks?

During my extensive research, I have seen many workarounds handling this issue. (See this SO post for some good links.) My main concern is handling the memory leaks that come from using attachEvent() in IE. Anyways, after all of my research I found…
Aust
  • 11,552
  • 13
  • 44
  • 74
1
vote
5 answers

attachEvent can't use THIS javascript

I require Cross compatability IE7 upwards For an event listener. Due to the system I am using I can only use an external js file to create the listeners. I wish to create a rule for all textarea boxes, making they increase in height when they wrap…
user1554759
  • 69
  • 2
  • 7
1
vote
2 answers

Get the caller of the event from attachEvent

I am trying to do something simple: I have a bunch of Images which are being load through JS. I attach an event listener to the load event, and after the Image is being loaded, in the listener function I would like to get the calling Image and…
Light
  • 1,647
  • 3
  • 22
  • 39
0
votes
2 answers

this.style.backgroundColor don't work in IE7/8

my code is: Demo