IE8, the focus of input cannot be set with $.focus ()

Source: Internet
Author: User

  me.on ("Keydown.autotableevent",  '. Waitedit ', function  (event)  {                 if  (Event.keycode &NBSP;==&NBSP;13)  {                     var idx = opt._waitedit.index (This);                     if  (idx < opt._waitedit.length - 1)                          $ (Opt._waitEdit[idx  + 1]). Autoselectword ();                     return false;                 }                 if  (event.keycode == 38)  {                     var field = $ (This). Data (' field ');                     var list = opt._waitedit.filter ("[data-field= '"  + field  +  "']");//Get all Edit items for the current column                      var idx = list.index (This);                     if  (idx  > 0)                          $ (List[idx - 1]). Autoselectword ();                     return false;                 }                 if  (event.keycode == 40 )  {                     var field = $ (this). Data (' field ');                     var list = opt._ Waitedit.filter ("[data-field= '"  + field +  "]");                     var idx =  List.index (This);                     if  (idx < list.length - 1)                          $ (List[idx  + 1]). Autoselectword ();                     return false;                 }             })

At the beginning, there is no return false, except IE8, the other browser can enter and up and down the key to switch input focus.

But IE8 must add return FALSE. No, it seems that the event is scurrying, debugging into other parts of jquery, I did not chase.

This question is also discussed in HTTP://STACKOVERFLOW.COM/QUESTIONS/1326993/JQUERY-FOCUS-SOMETIMES-NOT-WORKING-IN-IE8. But their methods didn't work. the return to False is solved!


The method of locking the table head recently did not find very good. With floattable, but big table to card a 4, 5 seconds to line, sad.

IE8, the focus of input cannot be set with $.focus ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.