问题标签 [jquery-1.8]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ajax - POST is not getting through to web service
I've added my code to pastebin at the following address: http://pastebin.com/L03zGPhS The service is up and running. I can invoke it. I am additionally using firebug and getting the following results on the POST:
Showing the service function:
I can get this to work with jQuery 1.4.2, but I'm upgrading a lot of jQuery widgets to 1.8 and can't get the autocomplete to work. Am I missing something they changed in the AJAX autocomplete call. Documentation to a correct answer will suffice if it is useful.
UPDATE I found through Google Chrome that I'm getting a 500 error. I'm not certain why because I'm hitting localhost on both the service and the aspx page. Does anybody know if they changed something that would affect the security of hitting localhost, or if I could have possibly left out and important jQuery reference that would let autocomplete work for 1.4 but not 1.8?
javascript - iframe 中的输入元素无法获得焦点
在我的一个网页上,有一个包含表单元素的 iframe。出于某种原因,这些输入元素不能按预期方式工作:
- 如果单击文本字段,则不会获得焦点,并且不会将键入的文本放入其中。
- 如果相同的文本字段有 onclick="this.focus();" 设置,它按预期工作。
- 单选按钮按预期工作。
- 包含 iframe 的元素按预期接收点击事件。
- 我无法在 iframe 中标记文本。
这不会发生在所有浏览器中。
它发生在:
- IE >= 9
- 火狐18.0
- 铬 22.0.1229.94
- 歌剧 12.12
它不会发生在:
- 即 < 9
这里发生了什么,以及如何解决它?
编辑:这似乎是一个 jQuery 问题。它在使用 jQuery 1.8 时发生,但在使用 jQuery 1.7 时不会发生(不同版本之间没有区别)。
javascript - 如何将“live”从 jQuery 1.8.3 替换为 jQuery 1.9?
我的 Web 框架自动将我的 jQuery 脚本更新到当前的最新版本 1.9。
现在我的所有:
别再工作了。我主要将它与一些在我的页面中填充 html 的 ajax 一起使用。
我会知道如何在上一个版本中替换此功能。一位朋友告诉我改用“on”,但“on”仍然固定在同一个元素上。
说明,在这个例子中(没有 ajax),我使用一个“+”图标来显示一个“ul li list”。
(我知道该脚本不是有史以来最优化的,但它确实有效。我使用类来打开或关闭我的列表。如果访问者没有启用 JS,则不会隐藏任何内容,打开所有折叠列表)
笔记:
- 我试过https://github.com/jquery/jquery-migrate,但我唯一的消息是“JQMIGRATE:jQuery.fn.live() 已弃用”,而不是如何修复它。
jquery - 使用 Deferred.then() 将一些已解决的案例过滤为被拒绝的案例
我正在做一个可以返回{status: ok}
或{status: error}
与其他数据一起返回的 ajax 调用。
我想做一个.then(doneFilter)
检查status
成员然后修改的事情,这样延迟的现在只会在状态正常的情况下解决。
我不确定它的语法。有人可以给我写一个例子吗?
jquery - 在 jquery 1.9.1 中创建变量失败,在 1.8.3 中没有
我刚刚升级到 1.9.1 经过一些技术缺陷后所有工作除了:
如果我将此行放在 jquery 1.8.3 的控制台中,它将被接受,我可以使用 $newthumbs 检索它
在 1.9.1 中它失败了Error: Syntax error, unrecognized expression:
我已经阅读了更新日志,我没有看到任何相关的内容应该打破这一点。我可能不太了解 jquery,但这种语法看起来很标准。
发生了什么变化?
更新
我确实在这里找到了这个
带有前导空格的 HTML 字符串:出于安全原因,jQuery 1.9 限制了由 $() 处理的字符串。尽管我们建议您使用 $.parseHTML() 来处理任意 HTML,例如模板,但 1.1.0 版本的 Migrate 插件恢复了旧的行为。
jquery - 使用 Ajax 删除选择在 Jquery 1.8.3 中不起作用。与 1.4.2 配合良好
我在 JQuery 1.4.2 中使用以下内容,它工作正常。但是,如果我使用 Jquery 1.8.3 这将停止工作。
我还尝试将 success : function 更改为 done : function 因为它似乎已被弃用但没有帮助。
jquery - 如何克隆节点,复制数据但不复制事件处理程序?
jQuery 的clone
函数如下所示:
.clone( [withDataAndEvents ] [, deepWithDataAndEvents ] )
withDataAndEvents:一个布尔值,指示是否应将事件处理程序和数据与元素一起复制。
deepWithDataAndEvents:一个布尔值,指示是否应复制克隆元素的所有子元素的事件处理程序和数据。
这两个参数都会影响data
和 events
。是否可以只保留数据而不保留事件?基本上,我的理想clone
功能如下所示:
.idealClone( [withData] [, withEvents ] [, deepWithData ] [, deepWithEvents ])
withData:一个布尔值,指示数据是否应与元素一起复制。
withEvents:一个布尔值,指示是否应将事件处理程序与元素一起复制。
deepWithData:一个布尔值,指示是否应复制克隆元素的所有子元素的数据。
deepWithEvents:一个布尔值,指示是否应复制克隆元素的所有子元素的事件处理程序。
有没有办法实现这一点?
注意我正在使用 1.8.1,但欢迎所有版本的答案
jquery - 当我在“每个”中“克隆”时,为什么会丢失原始元素?
我正在尝试制作自己的clone
功能,但遇到了问题。我可以自己使用 jQuery 的clone
函数而不会出现这样的问题:`
(或者,在行动中看到它:http: //jsfiddle.net/Shawn/dCm59/2/)
但是,如果我尝试使其适用于元素集合(添加each
),它将删除原始:
(或者,在行动中看到它:http: //jsfiddle.net/Shawn/dCm59/3/)
为什么第二个版本删除了原版?
jquery - How can I create tabs (jQuery UI) with jQuery 1.8.3
I used to create tabs by calling $(element).tabs(...)
when I was using jQuery 1.4.4. Now, with jQuery 1.8.3, I get an error:
Uncaught TypeError: Object # has no method 'tabs'
Why such an error? The only difference is the version of jQuery (not even jQuery UI, just jQuery).
NB I'm using jQuery-UI version 1.10.0
javascript - jQuery 从 1.8.3 迁移到 1.9.1 在一行中停止工作,我不知道为什么
我正在使用这段代码:
它适用于 jQuery 1.8.3。
现在我更改为 jQuery 1.9.1,它停止工作
我的大多数其他代码都有问题,主要是我必须将 .live 更改为 .on 并解决了(我不知道这是否是正确的做法),但是使用此代码,我找不到问题.
这条线似乎给出了问题:
您可以在 jsFiddle 中对其进行测试,也可以更改为 jQuery 1.8.3,看看它是如何工作的。