As a WEB Front-end engineer for website development, we should optimize the performance of our self-developed website projects as much as possible, currently, most of the website performance optimizations found on the Internet are translated and reproduced from 14 or 34 yahooss. Yahoo's optimization recommendations focus on major aspects. The W3C Group below show
1> shielding function
1.1 shield all keyboard keys
1.2 Right-click the screen
Add oncontextmenu = self. event. returnvalue = false to the body tag.
Or
Function nocontextmenu (){If (document. All ){Event. cancelbubble = true;Event. returnvalue = false;Return false;}}
Or
1.3 Block Ctrl + N, Shift + F10, F5 refresh, and return keys
1.4 shield the browser from the "minimize" "maximize" "Close" key in the upper right corner
Or open the page in full screen mode.
Note: Add onbeforeunload = "
When it comes to websites performance was king. How long it takes-a page to load can mean the difference of millions of dollars for large ecommerce sites. In this lesson we'll use the intersectionobserver to check if an image is in the viewport to defer loading the image.Document.addeventlistener (' domcontentloaded ', () ={Const Lazyimages= Array.from (Document.queryselectorall (' Img.lazy '))); if(' Intersectionobserver 'inchWindow ' Intersectionobserverentry 'inchWindow ' Intersectionratio
Everyone has almost all the experience of shopping online, some websites will have a product magnifying glass function, is to move the mouse to the picture on the time, next to have another big picture display, equal to magnifying glass effect, that this kind of effect how realizes, I send the code to everybody, please everybody reference.
The above is a small series to introduce the implementation of the Web site based on JavaScript effect
This article mainly introduces how to implement the drag-and-drop shifting effect of website menus in JavaScript. It involves some techniques related to JavaScript dynamic page element styles and has some reference value, for more information about how to implement the drag/drop function of the website menu in JS, see
This article mainly introduces how to implement the job selection function of a talent website in javascript. It involves the skills related to javascript dynamic page element nodes and has some reference value, for more information about how to use js to select a talent website, see the following example. Share it wit
This article mainly introduces how to implement the drag-and-drop shifting effect of website menus in JavaScript. it involves some techniques related to JavaScript dynamic page element styles and has some reference value, for more information about how to implement the drag/drop function of the website menu in JS, see
This article mainly introduces the typical tab navigation Effect of Japanese portal website implemented by JS + CSS. It involves the dynamic traversal of page elements and style modification techniques of JavaScript, which has some reference value, for more information, see the examples in this article to describe the typical tab navigation Effect of Japanese portal web
This article introduces how to implement website traffic statistics code based on javascript through two code examples, if you are interested in js Website access statistics, you can learn about it. websites generally have access statistics tools, which are highly efficient and practical. Practical javascript can also
This article describes how to use javascript to skillfully operate img for abnormal website submission. If A table needs to submit data to server A, it will be submitted to server B if server A cannot access it, it is a good choice to use js operation img to complete the process.
Use javascript to skillfully manipulate img for
subsequent js Code, a cookie record "style" will be written in the cookie section of the browser, so here I will ask the browser to call the style based on the record (here there are two styles, one "white" and the other "black ").
.
Hosts file.
It should be added that the use of PHP cookies for reading is more effective than the use of js cookies for reading. Because I used to use js for cookie reading, but it still takes a little time to load js, it is not perfect in page browsing after switc
Foreign trade station do not want to let China visit, want to use JavaScript to detect browser language is the Chinese are blocked, but will be hurt to a lot of overseas Chinese, and from the statistics on the website overseas Chinese accounted for a lot, with the back-end PHP to determine whether for the mainland to find a half-day and no clue, this should be how to solve?
Reply content:
Foreign trade
Google provides access statistics and provides JavaScript statistics using Google.Code. This part of code has been changed several times. The latest version is asynchronous submission, that is, it does not affect the page display speed of your website. First, it displays your webpage, then, the backend quietly submits an HTTP request for statistics.
In https://www.google.com/analytics/settings/check_statu
This article mainly introduces how to use js to read the data returned from the dynamic website from the server. For more information about how to use js to read the data returned from the dynamic website from the server in html, see.
1、js.html page
JavaScript files that execute jquery need to be introduced
The Code is as follows:
New Document
Use JavaScript to determine whether the browser has disabled the pop-up window, and prompt the website viewer in a friendly way on the webpage.
Pop-up Blocker or other software that shields pop-up window advertisements (such as Google Toolbar) will shield any windows automatically opened by scripts except createpopup.Some common functions affected by this are window. open (), showmodelessdialog (), showmod
This article mainly introduces the four-level left-side website category menu implemented by js. The example analyzes some tips for tab switching using javascript operation page elements, for more information, see the examples in this article. Share it with you for your reference. The specific implementation method is as follows:
1.1 shield all keyboard keys
1.2 Right-click the screen
Add oncontextmenu = self. event. returnvalue = false to the body tag.
Or
Function nocontextmenu (){If (document. All ){Event. cancelbubble = true;Event. returnvalue = false;Return false;}}
Or
1.3 Block Ctrl + N, Shift + F10, F5 refresh, and return keys
1.4 shield the browser from the "minimize" "maximize" "Close" key in the upper right corner
Or open the page in full screen mode.
Note: Add onbeforeunload = "
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.