【发布时间】:2011-08-12 16:05:03
【问题描述】:
我使用了这里的代码jquery prepend + fadeIn
没有fadeIn 它可以工作
function updateResult(data) {
$('#test').prepend(
html
);
}
但fadeIn 仅在数据包含一个div 标签时有效,
$('#test').prepend(
$(html).hide().fadeIn('slow')
);
否则 FireFox 会返回错误
uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://code.jquery.com/jquery-latest.min.js :: <TOP_LEVEL> :: line 16" data: no]
如何重写这段代码?
更新。 在我的情况下,我已经通过这种方式解决了
data = data.replace(/(?:(?:\r\n|\r|\n)\s*)/gi, '');
$(data).hide().prependTo('#test').fadeIn('slow');
删除换行符后正常工作
【问题讨论】:
标签: jquery