Created
August 13, 2013 20:42
-
-
Save nanusdad/6225481 to your computer and use it in GitHub Desktop.
Handling difference between Chrome and Firefox for window.event and srcElement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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