Mootools:调用null方法
我有类似 $$('[map="true"]').addClass('hidden');
但有时地图不存在。我可以在不破坏js并且在方法调用之前不添加if条件的情况下调用mootools中的方法吗? AFAIR jQuery 默认检查此项。
I have something like $$('[map="true"]').addClass('hidden');
but sometime map is not exists. Can i call methods in mootools without breaking js and not adding if condition before method call? AFAIR jQuery check this by default.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的意图是使用
[map="true"]
作为选择器,就像$$
一样,那么它是一个字符串,而不是变量赋值。If your intention is to use
[map="true"]
as a selector, as seems to be with$$
, then it is a string, not a variable assignment.