2020-08-13 html page time + css css loading + JS copyright information addition + soft skills node and php

2020-08-13 Source of topic: http://www.h-camel.com/index.html

[html] How long does it take you to write a page

It is faster to implement with templates or ui plugins

Pure hand-tipped native code is relatively slow

[css] Will css loading block DOM tree parsing?

CSS is regarded as a resource that blocks rendering.

The loading of css will not block the parsing of the DOM tree, but it will block the rendering of the DOM tree; it will not block the download of js, but it will block the execution of js.

Improve user experience: CND hosting; css compression; reasonable use of cache;

[js] Write a method, when copying the content of the page, copy the copyright information at the same time

<script language="javascript" type="text/javascript">
    jQuery(document).on('copy', function(e){
      var selected = window.getSelection();
      var selectedText = selected.toString().replace(/\n/g, '<br>');  // Solve the line breaks conversion issue
      var copyFooter = '<br>---------------------<br>著作权归作者所有。<br>' 
                            + '商业转载请联系作者获得授权,非商业转载请注明出处。<br>'
                            + '作者:SOFIA<br> 源地址:' + document.location.href
                            + '<br>来源:博客园cnblogs<br>© 版权声明:本文为博主原创文章,转载请附上博文链接!';
      var copyHolder = $('<div>', {id: 'temp', html: selectedText + copyFooter, style: {position: 'absolute', left: '-99999px'}});

      $('body').append(copyHolder);
      selected.selectAllChildren( copyHolder[0] );
      window.setTimeout(function() {
          copyHolder.remove();
      },0);
    });
</script>

Source: https://blog.csdn.net/lzuacm/article/details/88197591

[Soft skills] Why does nodejs restart the process after updating the code, but not PHP?

Personally, I feel that the node operation will depend on the cache, and the process needs to be restarted to regenerate the cache. PHP will release resources when the request ends, which is equivalent to restarting and executing everything again.

Guess you like

Origin blog.csdn.net/vampire10086/article/details/108461059