gpt4 book ai didi

php - IE : Unexpected call to method or property access 中的奇怪 jQuery 错误

转载 作者:可可西里 更新时间:2023-11-01 00:25:18 25 4
gpt4 key购买 nike

与往常一样,在 Firefox、Chrome、Safari 和 Opera 中一切正常。但是 IE... 这是另一个故事:)

这是我的完整代码:http://pastebin.com/ZdzzFayJ

至少在IE中有一件好事,出现以下错误找我:

SCRIPT65535: Unexpected call to method or property access. 
jquery.min.js, line 3 character 29586

怎么了?我找不到错误:(


更新

我清理了我的代码,javascript 函数现在被称为 jQuery 插件。我仍然遇到错误,但现在我知道错误出在哪里了。

在我的代码中,我在 IE 提示错误消息的代码旁边添加了注释 IE ERROR

插件:http://pastebin.com/6Dnd1qtd

jQuery : http://pastebin.com/wiHALjZx

我不知道为什么 IE 会在那里中断。有什么解决方案吗?


问候,马里奥

最佳答案

对我来说问题如下:

我使用一个适用于所有环境的库。

我的lib.js

jQuery.ajax({
data : jQuery('form').serialize(),
url : '/'+action[1]+'/post_form',
type : 'POST',
dataType: 'json',
success: function(data){
$('#my_name_id').find('option').remove().end().append(data.select_options);

});

Json 返回:

select_options  "<option></option>"

一切顺利!但是,在一种形式中,#my_name_id 不是选择,而是一个隐藏字段,它是用户的预选值和禁用属性。

这就是 IE8 上的 jquery 检索错误的原因。

解决方案是:

我的lib.js

jQuery.ajax({
data : jQuery('form').serialize(),
url : '/'+action[1]+'/post_form',
type : 'POST',
dataType: 'json',
success: function(data){
if( $('#my_name_id').is('select') ) {
$('#my_name_id').find('option').remove().end().append(data.select_options);
}
});

希望对大家有帮助!

关于php - IE : Unexpected call to method or property access 中的奇怪 jQuery 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8263069/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com