Home  >  Article  >  Web Front-end  >  A solution to the jquery failure problem caused by js_javascript skills

A solution to the jquery failure problem caused by js_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:12:19985browse

The biggest headache in website development is the JS problem, not the PHP program development. The front-end page, JS is really frustrating, especially JS, you don’t know where the problem will go, and various compatibility issues You need to take both things into account, unlike writing a program where you only care about how to implement functions and how to write logic. If there is a problem with the js file, it will affect the operation of other js files. Today I encountered a very tangled thing, an inexplicable problem caused by js.

This js is a function that enhances the effect of the page, but after using it, jquery can be used on some pages, but it fails on some pages. I used firebug debugging in firefox and found that an error will be reported on some pages, and the pagination is obtained. The location will go wrong. Later, I found that jquery was indeed invalid as long as there was no paging, because js could not obtain the paging position.

Omitting 800 words in the middle, adjusting the front-end is the most annoying. I am not a front-end development engineer. These problems should be solved by front-end personnel, but as a PHP website developer, I can solve it myself if I can try my best. .

Later, I put the js file where the problem was determined to be at the bottom, and the problem was solved. It was really baffling! It may be that the problematic part is put at the end, so that it will not affect the subsequent js operation. This is a rule of thumb. .

Do you think what I said makes sense?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn