Commit 33ccf9a322b2093a341d74b316f16f9049c05d93
1 parent
d9202ae3
fix event bind error
Showing
1 changed file
with
4 additions
and
2 deletions
editer.html
@@ -71,9 +71,11 @@ | @@ -71,9 +71,11 @@ | ||
71 | <script> | 71 | <script> |
72 | $(function() { | 72 | $(function() { |
73 | var selection, range; | 73 | var selection, range; |
74 | - $('.editer').on('click, input', function(){ | 74 | + $('.editer').on('click input', function(){ |
75 | selection = window.getSelection(); | 75 | selection = window.getSelection(); |
76 | - range = selection.getRangeAt(0);//找到焦点位置 | 76 | + if(selection.getRangeAt){ |
77 | + range = selection.getRangeAt(0);//找到焦点位置 | ||
78 | + } | ||
77 | }); | 79 | }); |
78 | $('#upload_btn').on('change', function(target) { | 80 | $('#upload_btn').on('change', function(target) { |
79 | target = $(this); | 81 | target = $(this); |