The most error-prone javascript interview questions

Source: Internet
Author: User

Article category: Web Front-end
I. multiple choice questions

1. Which of the following statements will generate a running error :()
A. var obj = ();
B. var obj = [];
C. var obj = {};
D. var obj = //;

2. Which of the following words does not belong to a reserved javascript word :()
A.
B. parent
C. class
D. void

3. Select a true expression :()
A. null instanceof Object
B. null === undefined
C. null = undefined
D. NaN = NaN

Ii. multiple choice questions

4. incorrect understanding of javascript :()
A. JScript is short for javascript
B. javascript is a Java scripting language developed by Netscape. It aims to simplify Java development.
C. There are a lot of compatibility problems between FireFox and IE mainly because they have different support for javascript.
D. javascript must be used for AJAX technology

5. If the foo object has the att attribute, which of the following methods can be used to obtain the value of the att attribute :()
A. foo. att
B. foo ("att ")
C. foo ["att"]
D. foo {"att "}
E. foo ["a" + "t" + "t"]

6. Which HTML tags can manually input text without specifying special attributes :()

1
2
3
4
A. <TEXTAREA> </TEXTAREA>
B. <INPUT type = "text"/>
C. <INPUT type = "hidden"/>
D. <DIV> </DIV>
7. Which of the following are global functions of javascript :()
A. escape
B. parseFloat
C. eval
D. setTimeout
E. alert

8. Which of the following statements about IFrame are true :()
A. Through IFrame, the webpage can embed other webpage content and can be changed dynamically
B. Embedded IFrame can be used to obtain the object of the outer webpage under the same domain name.
C. Under the same domain name, the outer webpage script can obtain the objects in the IFrame webpage.
D. You can use a script to adjust the IFrame size.

9. Which of the following statements about the table are true :()
A. the table can contain TBODY elements.
B. the table can contain the CAPTION element.
C. The table can contain multiple TBODY elements.
D. The table can contain COLGROUP elements.
E. The table can contain the COL element.

10. Which of the following statements about the window object of IE are true :()
A. window. opener attributes itself point to window objects
B. The window. reload () method can be used to refresh the current page.
C.window.location”a.html#and zookeeper location.href?a.html=the front page is replaced with an a.html page.
D. defines the global variable g. You can use window. g to access this variable.

Iii. Q &:

1. about the use of the javascript array sorting method sort (), focusing on the use of the sort () parameter and its internal mechanism

2. Briefly describe the differences between DIV elements and SPAN elements.

3. Combine the text structure to discuss the differences between innerHTML outerHTML innerText.

4. Description of several XHTML specifications (at least 3)

5. What are the related knowledge about Web standardization (or website reconstruction) and how many Web standards do you know?

Iv. Program questions:
1. Complete the content of the foo () function. A dialog box is displayed, prompting which of the following single orders are selected.

1
2 <body>

3 <script>

4 function foo (){

5 // Add code here

6 return false;

7}

8 </script>

9 <body>

10 <form name = "form1">

11 <input type = "radio" name = "radioGroup"/>

12 <input type = "radio" name = "radioGroup"/>

13 <input type = "radio" name = "radioGroup"/>

14 <input type = "radio" name = "radioGroup"/>

15 <input type = "radio" name = "radioGroup"/>

16 <input type = "radio" name = "radioGroup"/>

17 <input type = "submit"/>

18 </form>

19 </body>

20
2. Fill in the function body of the annotation part to bring up the "successful" dialog box for foo () function call. The Code should be as short as possible.

1 function foo (){

2var str = reverse (a, B, c, d, e, f, g );

3 alert (str );

4if (str = g, f, e, d, c, B, a) alert (successful );

5 else alert (failed );

6}

7 function reverse (str ){

8 // Add code here to complete the string flip Function

9}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.