Opened 16 years ago
Closed 14 years ago
#1256 closed bug (fixed)
Error involving e.which/e.keycode
Reported by: | bgoldman | Owned by: | brandon |
---|---|---|---|
Priority: | minor | Milestone: | 1.1.3 |
Component: | event | Version: | 1.1.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Here's a paste from FireBug:
setting a property that has only a getter fix(keypress charCode=118, keyCode=0)jquery.js (line 2976) handle(keypress charCode=118, keyCode=0)jquery.js (line 2923) handle()jquery.js (line 2812) [Break on this error] event.which = event.keyCode;
Change History (6)
comment:1 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 16 years ago by
Component: | ajax → event |
---|
comment:3 follow-up: 4 Changed 14 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
$(document).ready( function() { $(window).keypress(function (e) { if ( (e.which == null && e.type == "keypress") && event.keyCode != null ) e.which = e.keyCode; if( (e.keyCode == 0xA || e.keyCode == 0xD) && e.ctrlKey) { if (window.getSelection) { var selectedText = window.getSelection(); } else if (document.getSelection) { var selectedText = document.getSelection(); } else if (document.selection) { var selectedText = document.selection.createRange().text; } $.ajax({ type: "POST", url: "errorsc", data: {text:[selectedText], pageurl:[window.location.href]}, success: function(msg) { alert(msg); } }); } }); });
FireBug says: setting a property that has only a getter
comment:4 Changed 14 years ago by
change
data: {text:[selectedText], pageurl:[window.location.href]},
to
data: {text:""+selectedText+"", pageurl:[window.location.href]},
and enjoy
comment:5 Changed 14 years ago by
Owner: | set to brandon |
---|---|
Status: | reopened → new |
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'm not able to reproduce this. Feel free to attach a test case that illustrates the bug.
Note: See
TracTickets for help on using
tickets.
This is fixed in Rev [2009]