This is a known issue in jQuery mobile device. Offensive line jquery.mobile.navigation.js: 913 .
// Kill the keyboard. // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead, // we should be tracking focus with a live() handler so we already have // the element in hand at this point. // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement // is undefined when we are in an IFrame. try { $( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur(); } catch(e) {}
There's a blur() call that sends IE windows to the back of the stack.
As a workaround, you can avoid this by placing script tags physically in the <head> HTML.
<!DOCTYPE HTML> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" /> <script src="http://code.jquery.com/jquery-1.6.2.js"></script> <script src="http://code.jquery.com/mobile/latest/jquery.mobile.js"></script> ...
Placing script tags elsewhere in the document or pasting them through a script causes an error.
This script demonstrates a workaround in action. Note that this only works in a top-level document . If the document is in an <iframe> , an error will be displayed. Thus, if you open the JSFiddle editor in IE 7/8, it will still be sent back; but if you open only rendered HTML , it will not.
source share