Nginx optimizes static file access
brief introduction
The static files needed in web development are: CSS, JS, font and picture, which can be accessed through web framework, but the efficiency is not optimal.
Nginx is much more efficient than Web framework in processing static files, because it can use gzip compression protocol to reduce the volume of static files, speed up th ...
Posted by cent on Mon, 04 May 2020 04:54:50 -0700
Preventing bubble events in jQuery preventing default behavior
The bubbling event is to click the child node, which will trigger the parent node and the ancestor node to click the event.
Here is the html code:
<body>
<div id="content">
Outer div element
<span>Inner span element</span>
Outer div element
</div>
<div id="msg"></div>
</body> ...
Posted by gutogouveia on Sun, 03 May 2020 15:06:10 -0700
Using JavaScript to get the parameters of url delivery
1. Get all parameters of url
We can get this part directly through window.location.search, which is the url parameter we need. When the url does not contain?, window.location.search returns undefined.
function getUrlVal(str){
if(!str || str.indexOf('?') != 0) return false;
var urlValArry = str.replace('?','').split('&');
var ur ...
Posted by hyp0r on Sun, 03 May 2020 10:49:25 -0700
javascript learning notes (ES6's most commonly used syntax)
Common features of ES6
let,const
ES5 has only global scope and function scope, but no block level scope. Let adds a block level scope to JavaScript. The variables it declares are only valid in the code block where the let command is located.
{
{
let a = 1;
let b = 1;
console.log(a);// 1
...
Posted by Skunkmaster on Sun, 03 May 2020 06:34:42 -0700
jquery's $. ajax() and php background interaction
Look at it. A series of tutorials on novice ajax : I have a preliminary understanding of Ajax, but I mainly want to use ajax to interact with php in front and back, so I want to realize this idea step by step, because I am not particularly familiar with Ajax, so I write rookie like code, sorry..
After reading the series of novice ajax tutori ...
Posted by Dm7 on Sun, 03 May 2020 01:32:16 -0700
Baidu single point mobile function
I haven't written CSDN blog for a long time. Today I wrote two at a time. This is the third one. I can't stop at all. Haha, the last one let us know how to call Baidu map to locate. This time, I'll tell you how to call Baidu single point mobile function.
The so-called single point mobile function, in fact, is that Baid ...
Posted by eliezer on Sun, 03 May 2020 01:30:04 -0700
JS remove the space before and after the string or remove all spaces
From script house:
This article mainly introduces the use of JS to remove the spaces before and after strings or all spaces. Please refer to the following for your friends:
The code is as follows:
function Trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
Description:
If you use jQuery to directly use the $. trim(str) method, str r ...
Posted by codeDV on Sun, 03 May 2020 00:01:51 -0700
A standard ajax
A standard ajax
Reader's words: after summarizing the past work, I found that I have made a lot of progress. In order to thank the fans for their support, I will strive to build a boutique blog, change the habit of making comments for myself. Again, I hope you can criticize and correct me. If you have solved your problem, remember to pay a ...
Posted by SoberDude on Sat, 02 May 2020 23:35:41 -0700
js event listening (compatibility considered)
explain:
Internet
The addEventListener() method is not supported in Explorer 8 and earlier IE versions, and is not supported in Opera 7 and earlier Opera versions. However, for browsers that do not support this function, you can use the attachEvent() method to add event handles.
Internet
Explorer 8 and earlier does not support the remo ...
Posted by cliftonbazaar on Sat, 02 May 2020 21:41:11 -0700
Native javascript prevents trigger of jquery from triggering mouse events
In the process of the project, the user will trigger an event. It is necessary to trigger the corresponding event for another element and then execute the corresponding code. In jquery, it can be implemented through trigger
trigger API
Today, I thought about how to implement js without jq? Recently, I read the book "javascript advance ...
Posted by Sj0wKOoMel on Sat, 02 May 2020 20:48:35 -0700