[英]same jquery code works differently in file and console
why when I execute 为什么当我执行
$(".b").show(1000);
in console of chrome dev tools it animates but when I put it in js file it's just displays element? 在chrome dev工具的控制台中,它会进行动画处理,但是当我将其放在js文件中时,它只是显示元素?
thanx in advance 预先感谢
UPD UPD
<div class="b"></div>
is in html <div class="b"></div>
用html表示
$.ajax({
url: "/some/url.php",
}).done(function ( data ) {
$(".b").show(1000);
});
Ok, here's a checklist: 好的,这是一个清单:
is the code executed on DOM ready? 在DOM上执行的代码准备好了吗?
does the element exist on the DOM during execution? 执行期间元素是否存在于DOM上? if not, nothing is shown.
如果没有,则不显示任何内容。
is the div styled or not empty? div的样式是否为空? empty divs with no padding, no background, no borders and/or
0
height don't appear. 没有填充,没有背景,没有边框和/或
0
高度的空div不会出现。
does the AJAX return a success? AJAX是否会成功返回?
what does the console say? 控制台怎么说? 404?
404? Cross-domain restricted?
跨域限制? Syntax error/Unexpected token at..?
语法错误/意外令牌位于..?
Could this help ? 能帮上忙吗?
$.ajax({
url: "/some/url.php",
}).done(function ( data ) {
$(".b")live().show(1000);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.