基础

6 篇文章 0 订阅
2 篇文章 0 订阅
1)    What is the difference between Client side JavaScript and Server side JavaScript.?
My Answer:of course , Client side JavaScript is compiled by the browser js engine, and it focus on showing the data or effects on a page,  but the Server side JavaScript is compiled by server side js engine, node.js is a typical application, and it focus on dealing with the data from browser and responsing to the browser

3)    What does the attribute defer/async do when added to the script tag?
My Answer:when attribute defer has added to script tag, it will delay executing the srcipt, so this attribute can improve the download performance of a page.
when attribute async has added to script tag, the page will download this script file Asynchronously.
4)    How do you check if a variable is an object?
My Answer:use typeof.
5)    What is Strict Mode in JavaScript and why we use it?
My Answer:Strict Mode is a mode using word “use strict” in the functions, so the js engine can run the code strictly, it will help us to find the potential bug in the code. So we use Strict Mode to debug the js code faster and more convenient.
6)    What are windows object and navigator object in JavaScript?
My Answer:window object is browser window, it’s a global object, it has many common function or  variable that we can use without write the word “window”, like , alert(), document.  Navigator object contains the information of browser; we don’t use much of it.
7)    How to detect the operating system on the client machine in JavaScript?
My Answer:we can use ”navigateor.userAgent” , but sometime it can’t work correctly,  it depends on the browser .
8)    What is escape () function in JavaScript?
My Answer:escape (string) function can encoded   “string”  except  ASCII words , numbers and the words like : * @ - _ + . /. So we can read  the words in other  computers with the other function :unescape(string).
9)    Describe what event bubbling is?
My Answer:Event bubbling is a event which is triggered from particular target object  to parents object  and so on , it will end  by document object  or window object.
10)    Explain JS Namespace?
My Answer:
11)    Explain JavaScript Modular Pattern?
My Answer:
12)     What is the concept of “functions as objects” and how does this affect variable scope?
My Answer:
13)     What is the difference between .call () and .apply ()?
My Answer:they have the same function but different parameters, the second parameter is a array with all the parameters in it of apply() ,but  the parameters in call () used directly after the first parameter.
14)     What is the output of “1"+2+4 =?
My Answer:124
15)    What is the output of 3+4+"7" =?
My Answer:77
16)    How to add a function as a property in a JavaScript object? Give an example.
My Answer:
var obj = {};
obj.prototype.newfun = function(){
    do something;
}


1)    What is the importance of the HTML DOCTYPE?
My Answer:<! DOCTYPE > has 3 types : strict, transtistional, frameset, the tree different types have different level of support  to some special elements. Without using this , some potential bug will occur.
2)    What are selectors in jQuery?
My Answer:selectors can locate the element in the document, so we can change the attribute or css, add class, remove calss and so on or add event to the elemnent.
3)    What is chaining in jQuery?
My Answer:The chaining in jQuery allow us to do more than one action to the element object one by one. Like,$(“#testdi”).css(“background-color”,”#f00”).slideup(2000).slidedown(2000);
4)    What is Semantic HTML?
My Answer:
5)    Ways to store data in HTML as objects locally?
My Answer:localStroage.setItem  and sessionStroage.setItem.$(“”).data();
6)    What is the use of jQuery.data()?
My Answer:jQuery.data() is used of storing and getting data with key and value.
7)    What is difference between $(this) and ‘this’ in jQuery?
My Answer:”this” is a dom object and it can use element attribute, $(this) is jQuery object and it can use jQuery function.
8)    What is the use of param() method?
My Answer:
9)    What is jQuery.holdReady() function?
My Answer:
10)    What is difference between prop and attr?
My Answer:
11)    Explain the use of the .pushStack() method.
My Answer:
12)    What is the advantage of using the minified version of JQuery rather than using the conventional one?
My Answer:The minified version is smaller than the conventional one, so it is downloaded faster, and the page will show faster than using the conventional one.
13)    What is the difference between jquery.size() and jquery.length ?
My Answer:They almost the same, but ,.size() is a function , .length is a attribute, and .size() work like this : size: function(){ return this.length}; so .length is better.
14)    What is the use of jQuery Connect?
My Answer:
15)    Differentiate between jquery's ready and holdReady?
My Answer:
16)    What is the advantage of collapsing white space?
My Answer:


1)    Explain the difference between visibility:hidden; and display:none; ?
My Answer:visibility:hidden will hide the element and still take the space just like it show in the page, but display:none will not take the space until it show up again.
2)    What is a sprite? How is it applied using CSS? What is the benefit?
My Answer:It is a way to download icons with less http requests, cause many small icons will gather in a single picture, and we can use the position of each icon in the picture to use them, so  the benefit is reduce the http requests and picture numbers with less bandwidth.
3)    What is a CSS reset. What is the difference between a CSS reset and normalize.css?
My Answer:CSS reset is resetting the default style of elements in different browser. normalize.css also is reset the css of different browser, but it keeps some useful  default style, and unifies styles in different browser, and fixes some bug  in some browser  , so it is more useful.
4)    How do CSS precedence/cascading rules work?
My Answer:External style sheet < Internal style sheet < Inline style.
5)    What is !important value key-word in a style declaration?
My Answer:using !important key-word in a style declaration can make this style get the highest precedence.
6)    How does the !important directive affect the rules?
My Answer:
7)    What are Pseudo Classes?
My Answer:Pseudo Classes is used like this: selector:pseudo class { property: value; }, pseudo class include :link,visited, active,hover.
8)    What is grouping in CSS?
My Answer:grouping is when many selectors have same style, then all these selectors gather to be a grouping which defines one style. For example, #a , .b, div{ color:#f00; }
9)    What is Contextual Selector?
My Answer:Contextual Selector is used to set style with more than one element, class or id, and all these Selectors have some kind of Hierarchical relationship,  for instance, #a  .b  div table tr td{background:#f00;}
10)    Explain CSS media queries ?
My Answer:Media queries  is a  new feature in CSS3, it is used of  dealing with the devices have  different sizes of screen, and help to select  different css file or style.
11)    Explain css inheritance ?
My Answer:css inheritance : when  a element had set some kind of styles, and these styles will still work on  the children elements.  
12)    Difference between Margin and Padding?
My Answer:margin表示的是外边距,padding表示的是box结构中的内部填充距离。
13)    What is the "Box Model" in CSS? Which CSS properties are a part of it?
My Answer:
14)    What are the various techniques for clearing floats?
My Answer:
15)    What are the benefits of SVG?
My Answer:1, the file is small, 2, it can be enlarged without any loss, 3,it is awesome when it works in the Retina screen. 4, we can control the style of the picture.
16)    What does z-index do?
My Answer:z-index must use with the style: position: relative, fixed, absolute, it can make a affection like pictures floating over the browser.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值