(1) 减少http请求次数:CSS Sprites, JS、CSS源码压缩、图片大小控制合适;网页Gzip,CDN托管,data缓存 ,图片服务器。 (2) 前端模板 JS+数据,减少由于HTML标签导致的带宽浪费,前端用变量保存AJAX请求结果,每次操作本地变量,不用请求,减少请求次数 (3) 用innerHTML代替DOM操作,减少DOM操作次数,优化javascript性能。 (...
Front-end development refers to the visuals that you may see on the web pages, where end users may interact with some of the web elements. The Front end majorly makes use of HTML, CSS, and JavaScript to create interactive web pages. 20. How does a CDN enhance website performance? Conten...
The foreach() method in JavaScript returns undefined, so we cannot perform any calculations on it. It can be used to perform side effects in arrays like logging or saving value to the database, etc. 10. What is the difference between ‘===’ and ‘==’ in Javascript? === == Compar...
The questions below were asked in a preliminary check before the actual interview. The role itself was for a “JavaScript Engineer”. This particular set of questions is from a job I applied to over a year ago. I’ve chosen to share them here because I think readers of this blog would ...
How to set table cellpadding and cellspacing in CSS How to remove cellspacing from tables using CSS How to place border inside of a DIV element using CSS How to change image on hover with CSS How to position text over an image using CSS How to create an HTML button that acts like a li...
JavaScript is an object-oriented scripting language that has evolved from a means to manipulate static HTML and CSS websites into the backbone of today’s most dynamic and interactive websites. Its popularity has increased in recent years because it has branched from just a browser-based language...
Good interviewers hardly plan to ask any particular question during interviews, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer. So always clear your basic fundamentals to create a good impression....
javascript"> var nodes = document.getElementsByTagName("li"); for(i = 0;i<nodes.length;i+= 1){ nodes[i].onclick = function(){ console.log(i+1);//不用闭包的话,值每次都是4 }(i); } </script> 执行say667()后,say667()闭包内部变量会存在,而闭包内部函数的内部变量不会存在使得...
HTML5 is what many people consider to be the next big development on the web. What is interesting is that HTML is not an official standard yet – the W3C’s (World Wide Web Consortium – a group of people devoted to evolving the web) plan is to have HTML5 become “official” in ...
JavaScript旨在创建以网络为中心的应用程序。 JavaScript是Java的补充和集成。 JavaScript是HTML的补充和集成。 JavaScript是开放的且跨平台的。 What are the advantages of using JavaScript? 以下是使用JavaScript的优势- 更少的服务器交互-您可以在将页面发送给服务器之前验证用户输入。这样可以节省服务器Stream量,这意...