JQuery repeated loading error and solution _ jquery

Source: Internet
Author: User
This article mainly records all js failures caused by repeated jQuery loading in the project, and analyzes them step by step to get the complete process of the final solution, which is mainly recorded, remind yourself not to make the same mistake in the future. Recently, when I was working on a project, I encountered a problem:

The parent page introduces the child page and the Child page introduces the jQuery. js file. The parent page JS depends on jQuery. js. The problem is that the JS object is always prompted to be invalid. I guess the loading sequence of jQuery is not the earliest.

Parent page:


Subpage:


From this point of view, jQuery. js is the earliest, but why are other js prompts that the attribute is invalid.

Later I used the F12 tool of IE11 to check the JS loading sequence. I found that jQuery was the first to load, but after loading the page, a request suddenly loaded jQuery again.



The reason is the following code:

The Code is as follows:


$ (Function (){
$ ("# Zjyw_table_1"). load ("xxx. jsp ");
}


JQuery. js is loaded in xxx. jsp. It is normal to comment this sentence.

This problem has been quite depressing for a long time. Record it to help others.

After finding the solution, the solution is very simple. Here we will share with you the idea of querying the problem. If you have the same problem, you can refer to it.

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.