Сегодня 15 мая, среда ГлавнаяНовостиО проектеЛичный кабинетПомощьКонтакты Сделать стартовойКарта сайтаНаписать администрации
Поиск по сайту
 
Ваше мнение
Какой рейтинг вас больше интересует?
 
 
 
 
 
Проголосовало: 7273
Кнопка
BlogRider.ru - Каталог блогов Рунета
получить код
coding4.net
coding4.net
Голосов: 1
Адрес блога: http://www.coding4.net/
Добавлен: 2012-06-11 20:16:46
 

Вопросы на собеседовании по JavaScript, Client-side

2012-09-22 23:42:00 (читать в оригинале)


JavaScript

1. Write a javascript function getObject(id) compatible with every browser.

function getObject(the_id)
{
  if (typeof the_id != 'string')
  {
    return the_id;
  }
  if (typeof document.getElementById != 'undefined') {
    return document.getElementById(the_id);
  } else if (typeof document.all != 'undefined') {
    return document.all[the_id];
  } else if (typeof document.layers != 'undefined') {
    return document.layers[the_id];
  } else {
    return null;
  }
}

2. What is a prototype in javascript?

В общих чертах prototype - это свойство позволяющее добавлять уже существующим объектам свойства, также используется для эмуляции наследования классов в JavaScript. Подробный ответ написан здесь . Еще как вариант, можно упомянуть о Prototype.js. Это популярная библиотека добавляющая удобные ООП возможности в программы на JavaScript-е.

3. Describe the differences between IE and W3C event models

4. Write JavaScript code that implements the following C++ concepts as close as possible:

4.1. Instance methods

4.2. Class methods

4.3. Inheritance

4.4. Base constructor call

4.5. Method overloads

4.6. Private properties and methods

4.7. Static properties and methods

4.8. Privileged methods

5. You have a ready HTML page on a server. You can only add new files or change section of this page. Show what is needed to be changed in order to display a small image after each hyperlink on the page in question.

6. What is the conceptual difference between
and ?

7. What is cross-domain vulnerability ? How it can be prevented ?

8. How to avoid loading the page on link click? Can you come up with more than one way to do it?

9. Write a function that generates functions.

10. Assume func1 and func2 are already defined. In a page like this:


<body onload=”func1()”>
… content …
</body>
<script>func2()</script>
Which function will run first? Why?


11. What is JavaScript closure? Write minimal code to demonstrate its effect.

12. What !DOCTYPE do you usually use? Why? What effect it has on the browser?

13. In most general case, is JavaScript single-threaded or multi-threaded?

14. You want to play some music on a web page. List as many solutions as you can how to achieve this.

15. How would you convert existing HTML files to XHTML?

16. Are there any problems with PNG files in Internet Explorer 6? If yes, how to solve them? What about IE7?

17. What do you know about memory leaks in JavaScript? Write sample code to demonstrate the problem and some code to demonstrate a solution.

По мере сил и времени буду добавлять ответы. Ответы не окончательные и обсуждаются. Жду интересного обсуждения в комментариях.


Тэги: html, javascript, вопрос, собеседование

 


Самый-самый блог
Блогер ЖЖ все стерпит
ЖЖ все стерпит
по количеству голосов (152) в категории «Истории»


Загрузка...Загрузка...
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.