什么是Document.all?true:false [英] what does it mean Document.all?true:false

查看:167
本文介绍了什么是Document.all?true:false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么意思Document.all?true:false



我读过这个但我不明白。

我需要知道这点,请帮帮我。



提前谢谢。

What does it mean Document.all?true:false

I read about this but I didn't understand.
I need to know this, please help me.

Thanks in advance.

推荐答案

这是一个简写for:

It is a shorthand for:
if (Document.All)
   {
   return true;
   }
else
   {
   return false;
   }

只有你可以在作业中使用它:

Only you can use it in an assignment:

bool result = Document.all?true:false;

但在这种情况下,这是浪费空间,因为等价的代码是

But in this case, it is a waste of space, as the equivalent code would be

bool result = Document.all;


你真的不需要了解它。

这是遗留代码,专为IE4时代设计。
You don't really need to know about it.
It is legacy code, designed for the days of IE4.


这篇关于什么是Document.all?true:false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆