单项选择题使用JavaScript识别浏览器时,应尽量使用()。

A.浏览器信息对象的方法
B.浏览器功能识别的方法
C.以上两者结合的方法


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题建立JavaScript函数库的目的是()。

A.减少重复编程
B.统一编程风格
C.节省装载JavaScript函数的时间
D.以上都是

2.单项选择题如何获得客户端浏览器的名称?()

A. client.navName 
B. navigator.appName 
C. browser.name 

3.单项选择题打开名为 "window2" 的新窗口的 JavaScript 语法是?()

A. open.new("http://www.w3school.com.cn","window2") 
B. new.window("http://www.w3school.com.cn","window2") 
C. new("http://www.w3school.com.cn","window2") 
D. window.open("http://www.w3school.com.cn","window2") 

4.单项选择题如何求得2和4中最大的数?()

A. Math.ceil(2,4) 
B. Math.max(2,4) 
C. ceil(2,4) 
D. top(2,4)

5.单项选择题如何把 7.25 四舍五入为最接近的整数?()

A. round(7.25) 
B. rnd(7.25) 
C. Math.rnd(7.25) 
D. Math.round(7.25)

6.单项选择题可插入多行注释的 JavaScript 语法是?()

A. /*This comment has more than one line*/ 
B. //This comment has more than one line// 
C. <!--This comment has more than one line-->

7.单项选择题如何在 JavaScript 中添加注释?()

A. ' This is a comment 
B. <!--This is a comment--> 
C. //This is a comment 

8.单项选择题for 循环如何开始?()

A. for (i <= 5; i++) 
B. for (i = 0; i <= 5; i++) 
C. for (i = 0; i <= 5) 
D. for i = 1 to 5

9.单项选择题在 JavaScript 中,有多少种不同类型的循环?()

A. 两种,for 循环和 while 循环 
B. 四种,for 循环、while 循环、do...while 循环以及 loop...until 循环
C. 一种,for 循环

10.单项选择题如何编写当i不等于5时执行一些语句的条件语句?()

A. if =! 5 then 
B. if <>5 
C. if (i <> 5) 
D. if (i != 5)