当前位置:Gxlcms > JavaScript > jQuery 注意事项 与原因分析

jQuery 注意事项 与原因分析

时间:2021-07-01 10:21:17 帮助过:1人阅读

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

人气教程排行