Home  >  Article  >  Web Front-end  >  jQuery Precautions and Cause Analysis_jquery

jQuery Precautions and Cause Analysis_jquery

WBOY
WBOYOriginal
2016-05-16 18:53:411228browse

1. In addition to a method, there must be a global method of jQuery to start. For example, if I want to call method a for ajax submission, then in any <script></script> tag of the page, add jQuery(function (){}), and this sentence must be placed globally, not inside a method block, otherwise jQuery.post() of method a will not work:

Copy code The code is as follows:


<script> <br>jQuery(function(){}) <br>function a(url){ <br>jQuery.post(url); <br>} <br></script>


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