Microsoft AJAX jscript $发现不能在隐藏/不可见元素上工作吗? 我似乎无法得到它的工作,但我不知道这是否是预期的行为。
2
A
回答
4
如果你设置了一个控制false
的Visible
属性,那么$find
不会找到任何东西,因为asp.net不会产生与Visible
属性设置为false
控件的HTML。但它应该工作,如果您使用CSS/JavaScript隐藏控制。
+0
+1刚刚疯了,直到我意识到这一点 –
0
你是积极的元素是在DOM(即:可见= True)?下面是一些reference info为预期的行为:
$find
实际调用findComponent
:
Sys.Application = new Sys._Application();
window.$find = Sys.Application.findComponent;
findComponent: function _Application$findComponent(id, parent) {
/// <summary locid="M:J#Sys.Application.findComponent">Finds top-level components that were added through addComponent if no parent is specified or children of the specified parent. If parent is a component</summary>
/// <param name="id" type="String">The id of the component to find.</param>
/// <param name="parent" optional="true" mayBeNull="true">The component or element that contains the component to find. If not specified or null, the search is made on Application.</param>
/// <returns type="Sys.Component" mayBeNull="true">The component, or null if it wasn't found.</returns>
//#if DEBUG
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "parent", mayBeNull: true, optional: true}
]);
if (e) throw e;
//#endif
// Need to reference the application singleton directly beause the $find alias
// points to the instance function without context. The 'this' pointer won't work here.
return (parent ?
((Sys.IContainer.isInstanceOfType(parent)) ?
parent.findComponent(id) :
parent[id] || null) :
Sys.Application._components[id] || null);
},
相关问题
- 1. 元素克隆隐藏/显示不适用于克隆元素
- 2. JQuery发现不适用于tr元素?
- 3. 如何隐藏元素,如果另一个元素不存在或不可见?
- 4. 此显示/隐藏功能不适用于MultiSelect元素
- 5. 自动隐藏可见子元素
- 6. 点击隐藏可见元素D3.js
- 7. 使元素可见并隐藏点击
- 8. 用AJAX显示/隐藏JSF元素后如何隐藏触发元素?
- 9. jQuery如何不断检查元素是隐藏/可见的?
- 10. jquery选项卡中的隐藏元素不可见
- 11. 元素不是隐藏
- 12. 输入字段值与隐藏可见性隐藏不发布
- 13. js不适用于Rails中出现的ajax元素
- 14. 元素不可见
- 15. 硒发现隐藏的元素
- 16. 元素不会隐藏
- 17. 元素隐藏,但父()不
- 18. CSS不适用于元素
- 19. jQuery.css()不适用于元素
- 20. 填充不适用于容器元素内的元素吗?
- 21. 元素隐藏selemium webdriver错误“元素当前不可见,因此可能不会互动”
- 22. 元素初始隐藏时,幻灯片切换不适用?
- 23. ng-click不适用于btn元素
- 24. 获取元素不可见
- 25. 元素不可见:元素当前不可见,不能被操纵 - 硒的webdriver
- 26. 隐藏的元素在使用xpath时是可见的
- 27. Html5元素不呈现。 Html5shiv.js不适用于页面
- 28. 当能见度时隐藏元素之间的差距:隐藏
- 29. jquery slidetoggle()不隐藏:在元素之前
- 30. jQuery隐藏功能适用于“按钮”和“范围”,但不适用于“a”元素
为什么不直接使用的document.getElementById(“富”),这将不可见元素的工作? – jfriend00
我同意jfriend00;您可以使用$ get作为getElementById方法的快捷方式 – Romhein
$ get,$ find,document.getElementById(“foo”)在DOM中查找所有元素,而不管应用了什么CSS(display:none; visibility:hidden .. 。等等)。 –