0

I have a js function which accepts event object as an argument. In that js function, I assign that event object to a global variable. In another ajax callback I access that global variable (event object).

My Question:
the key code value of that event in both methods are same in both methods in Firefox, but it gives different value in IE 7? for example,if key code is 75, Firefox returns 75 in both methods. but IE7 gives 75 in method-1 and 0 in method-2

Why does it behave like this?

2
  • 1
    Can you post your code here ? May 23, 2011 at 10:56
  • You likely want to store the ID of the event's srcElement/target instead
    – mplungjan
    May 23, 2011 at 11:21

1 Answer 1

1

You can not pass the event object with IE, you need to create a new object and make a copy the properties that you want to use.

1
  • hai i have worked as you said.Now it works fine.Your answer is really useful. thanks a lot...
    – Alex
    May 23, 2011 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.