Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Created August 13, 2013 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanusdad/6225481 to your computer and use it in GitHub Desktop.
Save nanusdad/6225481 to your computer and use it in GitHub Desktop.
Handling difference between Chrome and Firefox for window.event and srcElement
'click .cancelbtn': function(e) {
// To handle difference between Chrome and FF
e = e || window.event;
var se_id = e.target || e.srcElement;
if (se_id) {
console.log('Worked' + se_id);
var c_id = se_id.id;
} else {
//var se_id = $(".cancelbtn").click(function (evt) { return value.Id } );
console.log('Did not work');
}
var todo_id = c_id.replace('cancelbtn_', '');
console.log('Clicked cancel :' + todo_id + ':');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment