Describe the problem scenario:
The 1.jquery version used is jquery-1.7.2.min.js
2. The code is not written on the page, it is appended after the event
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <Scriptsrc= "Js/jquery-1.7.2.min.js"type= "Text/javascript"CharSet= "Utf-8"></Script>7 <Scriptsrc= "Js/my97datepicker/wdatepicker.js"type= "Text/javascript"CharSet= "Utf-8"></Script>8 </Head>9 <Body>Ten <Divclass= "Main"> One A </Div> - <inputtype= "button"ID= "Ceshi"value= "Tap"onclick= "Ceshiclick ()"/> - </Body> the <Scripttype= "Text/javascript"> - varStr= "<input id= ' d4315 ' class= ' time_start wdate clearinput ' type= ' text ' onfocus=\ ' Wdatepicker ({maxdate: ' #F {$dp. $D (\ \ ' d4316\\ ') | | \ \ '%y-%m-%d\\ '} ', Onpicked:function () {$ (' #d4316 '). focus ();}}) \ "><span>-</span><input id= ' d4316 ' class= ' time_end wdate clearinput ' type= ' text ' onFocus=\ ' Wdatepicker ({maxdate: '%y-%m-%d ', mindate: ' #F {$dp. $D (\ \ ' d4315\\ ')} '}) \ ">"; - functionCeshiclick () { - $('. Main'). html (str); + } - </Script> + </HTML>
The Problem source code appearsCopy the above code to run the discovery: After selecting the first date input box value, the second input box gets the focus, but it does not perform the focus event of the second input box, so that the date control is displayed, but it is not a problem to find the wording in the description and introduction of the official website
resolution process:
This problem is encountered in the development of the project, and then start testing locally, to prevent the impact of other issues in the project, in the local test found whether directly written in the document flow in the page or appended to the problem, The only difference is that I have a local test with the Jquery-1.12.3.min.js version, and the test found that changing the jquery version resolved the issue
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <Scriptsrc= "Jquery-1.12.3.min.js"type= "Text/javascript"CharSet= "Utf-8"></Script>7 <Scriptsrc= "Js/my97datepicker/wdatepicker.js"type= "Text/javascript"CharSet= "Utf-8"></Script>8 </Head>9 <Body>Ten <Divclass= "Main"> One A </Div> - <inputtype= "button"ID= "Ceshi"value= "Tap"onclick= "Ceshiclick ()"/> - </Body> the <Scripttype= "Text/javascript"> - varStr= "<input id= ' d4315 ' class= ' time_start wdate clearinput ' type= ' text ' onfocus=\ ' Wdatepicker ({maxdate: ' #F {$dp. $D (\ \ ' d4316\\ ') | | \ \ '%y-%m-%d\\ '} ', Onpicked:function () {$ (' #d4316 '). focus ();}}) \ "><span>-</span><input id= ' d4316 ' class= ' time_end wdate clearinput ' type= ' text ' onFocus=\ ' Wdatepicker ({maxdate: '%y-%m-%d ', mindate: ' #F {$dp. $D (\ \ ' d4315\\ ')} '}) \ ">"; - functionCeshiclick () { - $('. Main'). html (str); + } - </Script> + </HTML>
jquery1.12 version
In order to test the real existence of the problem, the second input box in the onfocus event is changed to ordinary events, found that it can run normally, and change to my97 method is not, then the problem should be my97 method of it
Workaround Summary:
1. If you persist in using the jquery-1.7.2.min.js version, in the Onpicked event of the first input box, use the native JS implementation, which is $ (' #d4316 '). Get (0). focus ();
2. Either use the high version of jquery
Note: The real cause of this problem has not been found
My97datepicker Date Control--date input box linkage, use focus to make the second input box not show the date control