Home > Web Front-end > JS Tutorial > Baidu front desk js written test questions and answers_javascript skills

Baidu front desk js written test questions and answers_javascript skills

WBOY
Release: 2016-05-16 19:09:03
Original
1415 people have browsed it

The first question
Write a method to find the byte length of a string
The second question
How to control line breaks in alert
The third question
Explain document.getElementById("ElementID") .style.fontSize="1.5em"
The fourth question
Separate an effect similar to the picture into css and html
The fifth question
According to the format xxxx year xx month xx day xx time xx Dynamically display time in minutes and xx seconds. If less than 10 is required, add 0
Question 6
Write a method to remove duplicate elements from an array
Question 7
Name 3 or more scripts that are compatible with ff and ie Question
Question 8
Write a simple ajax example as required. If it is simple and meaningless, I will not write it
Answer
Code for the first question:


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

Second question: alert is in progress for line breaks

[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]

The third question: em is a Relative units.
I won’t do the fourth question.
Code for the fifth question:
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]


[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]
Data loading...


[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh it to execute
]

So serious, first question It is best to add parentheses to function definitions
It seems that only expressions can be without parentheses (do you want to show off :P)
In addition, the eighth question you wrote is too exaggerated. It is probably like this
OXMLHttprequest=new XMLHttpRequest();
OXMLHttprequest.open("post","/XXX.php",true)
OXMLHttprequest.onReadyStateChange=function()
{
if(OXMLHttprequest.readyState!=4) continue; alert(OXMLHttprequest.responseText); OXMLHttprequest.onReadyStateChange=null; OXMLHttprequest=null; } OXMLHttprequest.send("domain=baidu");
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template