扫码关注官方订阅号
认证高级PHP讲师
这是部分浏览器让开发者在控制台更加方便调试所设。
$表示document.querySelector$$表示document.querySelectorAll
$
document.querySelector
$$
document.querySelectorAll
类似的还有:
$x
$_
$0
$4
Chrome的文档
仅仅是为了方便调试使用,并不是所有浏览器都有。Chrome中是支持的,ff中返回的是这样
Chrome
ff
$$ function JSTH_$$() $ function JSTH_$()
w8.1 edge,IE10,IE9默认版本返回的是这样
w8.1 edge,IE10,IE9
$ >function(selectors,startNode){... >$$ >function(selectors,startNode){...
而IE8中返回的是下面这样,因此在IE8 下需要使用$()和$$()
IE8
$()
$$()
>$$ >function(selectors, startNode) { if (startNode) { return startNode.querySelectorAll.call(startNode, selectors); } return window.document.querySelectorAll.apply(window.document, arguments); } > $ > function(selectors, startNode) { if (startNode) { return startNode.querySelector.call(startNode, selectors); } return window.document.querySelector.apply(window.document, arguments); }
$同document.querySelector,$$同document.querySelectorAll
应该不是标配,但是比较新的浏览器似乎都支持
浏览器自带,实际上运行的都是:
with(__commandLineAPI) { xxx }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
这是部分浏览器让开发者在控制台更加方便调试所设。
$表示document.querySelector$$表示document.querySelectorAll类似的还有:
$x表示返回指定xpath的元素$_返回上次表达式的结果$0-$4返回上五次选取的DOM节点Chrome的文档
仅仅是为了方便调试使用,并不是所有浏览器都有。
Chrome中是支持的,ff中返回的是这样w8.1 edge,IE10,IE9默认版本返回的是这样而
IE8中返回的是下面这样,因此在IE8下需要使用$()和$$()$同
document.querySelector,$$同document.querySelectorAll应该不是标配,但是比较新的浏览器似乎都支持
浏览器自带,实际上运行的都是: