The HTML code obtained by the ajax request has a strange shift of focus in the input box of Firefox

Source: Internet
Author: User
This is a very strange thing.

On the front-end page, use ajax to request the asp.net background code, get a piece of HTML code, and then display the HTML code as the innerHTML of a Label in the webpage. This is my consistent practice of using ajax, it has never been inappropriate. There was no problem in IE testing, but it was strange to test it in Firefox later. The HTML code loaded through ajax contains some controls, such as text, select, and radio, some of the following controls do not always have the focus. When you click the text, select, or other controls at the end to prepare the input information, the input focus is like magic. When you release the mouse, you move the focus to the first control.

This problem also plagued me for two days. Later, when I was eating, I suddenly thought, is it not a label nesting non-standard problem? Cannot the label be nested with a div? Later, I changed the label on the webpage that accepted the HTML code into a div, so there would be no problem !, The problem was solved when it was excited. Haha...

Therefore, we must take it as a precaution. The HTML tag in the webpage must be nested in a standard so that our webpage can have a stronger vitality .. Otherwise, debugging is difficult.

Related Article

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.