Home  >  Article  >  Web Front-end  >  jQuery 注意事项 与原因分析_jquery

jQuery 注意事项 与原因分析_jquery

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

1.在一个方法之外,一定要有个jQuery的全局方法启动,例如我要调用a方法做ajax提交,那么在页面的任一<script></script>标签内,加入jQuery(function(){}),而且这句话要放在全局,不能在方法块里面,否则a方法的jQuery.post()则不会起作用:

复制代码 代码如下:


<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