Problem: The NAME property of the jQuery dynamic operation page element cannot be used in IE7.
There is a problem in the project, and some customers can occasionally, and the rear tens will not be able to get the data value of the front desk.
The development and test environment can not be reproduced. The pothole is here. If you can’t reproduce it, you can’t debug it, you can’t know that there will be such a problem.
Think about the only difference between the customer’s environment, only the JS cache problem, then add a current time parameter to the place referenced by all JS files, and the problem still exists.
The version of this is IE8, so I have never thought of a version compatibility problem. In the case of jQuery, jQeruy’s appearance is not known as a compatibility problem that solves the browser.
The problem of damn problems and real version issues. Because some pages need to use IE8 compatibility mode, the compatibility model is actually as compatible, isn’t it compatible with IE7?
Then use DEMO to test locally.
OK! IE8 compatibility mode:
$ ("# INPUT"). Attr (" Name "," MyName "); Alert (" Name: "+ $" # INPUT "). Attr (" Name ") +" *** HTML: "+ $" "# div"). html ())IE8:
$ (“# INPUT”). Attr (“Name”) taken It is a modified value, and$ (“# div”). Html ()
taken NameOr is it the original value? ?F12 View the generated HTML
What is the SubmitName? Obviously Name has not changed. Submitname should be the value of SubmitName directly read when jQuery is generated and then read Name.
$ ("# div"). There is no submitname in the value of html () ? ? I also don’t know how the HTML method in jQuery is achieved ~~
// Alert ("NAME:" + $ ("# INPUT"). Attr ("Name") + "* ** HTML: "+ $ (" # div "). HTML ()); $ (" # INPUT "). Attr (" Name "," MyName "); $ (" # Div2 "). HTML ($ ($). "#div"). HTML ()); var nameval = $ ("# div2"). Find ("INPUT [Name = 'MyName'). Val (); Alert (NameVal);
Solution:("# div"). HTML ("1. Direct Modify NAME with jQuery and then access Name is OK, although the middle is generated in SubmitName.2. You can first$ ("# div2"). HTML ($ ("# div"). Html ()); and then modify. Attr ("Name "," myname "); 3. Can directly spliced HTML.
The last Baidu is under, IE7 cannot be used to dynamically create and modify the JS dynamic creation and modification. Name value.
The above is a small-knit to give you a solution to the use of jQuery dynamic operation NAME issues in IE7, I hope that everyone has anything. If you have questions, please leave a message, the small package will reply to everyone in time. Thank you very much for your support of Tumi Cloud Website!