A solution to a js caused jquery failure problem

  • 2020-03-29 23:59:15
  • OfStack

Make the website development, the most headache is js problem, not PHP program development, the front page, js is really too much trouble, especially js, you do not know where the problem will be, all kinds of compatibility also have to take care of, unlike writing procedures, you only care about how to achieve function, how to write logic. Js file a problem, on the impact of the operation of other js, today encountered a very tangled thing, a js caused by the puzzling problem.

This js is a function to enhance the page effect, but with it, jquery can be used in some pages, some pages will be disabled, with firefox firebug debugging, found in some pages will report an error, get the page location will be wrong. It turned out that jquery really failed wherever there was no paging, because js couldn't get to the paging location.

I am not a front-end development engineer, and these problems should have been solved by the front-end staff, but as a PHP website developer, can try to solve their own solution.

Then I put the js file at the bottom, and the problem was solved. There may be a problem in the last place, also won't affect the later js run, this is an experience.

Related articles: