Python 3 Django (7) Django has many ways to transfer data from the background to the front.

Django has many ways to transfer data from the background to the front. Basic form: from django.shortcuts import render def main_page(request): return render(request, 'index.html') views to HTML usage data views is passed to HTML to use data Code in views: from django.shortcuts import render def main_page(req ...

Posted by Paragon on Tue, 31 Mar 2020 01:16:00 -0700

Native js implements Ajax requests, including get and post

Now the web requests data from the server, many of which use Ajax, but they are all wrapped with JQuery. In the previous project, because JQuery cannot be referenced, it can only be used in the native, not to speak much, please see the code. 1 /*-------------------Ajax start--------------------*/ 2 3 function ajax(options) { 4 options ...

Posted by bernouli on Tue, 31 Mar 2020 01:09:43 -0700

js reads the Excel table, js finishes clicking to copy the data

Crap Project requirements: read a block of excel according to the date; generate an array; click to copy the array for other purposes; Read different sheet s according to the week (lower left corner of Excel) Read Monday's title and Tuesday's title, in turn.. The Excel content area is as follows: Final effect example: U ...

Posted by skripty on Tue, 31 Mar 2020 00:00:38 -0700

Configure expiration time for static elements

Configure static element expiration time The browser will cache static files (pictures, CSS, JS) in the computer by default when visiting the website. So the next time you visit, you don't have to download remotely. How long is the cache? The browser will have its own mechanism to clear the cache. Or it can be set on the remote ...

Posted by jamiel on Mon, 30 Mar 2020 23:46:01 -0700

How to realize the communication between multiple tabs in the same browser (2) -- cookie+setInterval

Two, cookie (1) What is a cookie? HTTP cookies, often called cookies directly, were originally used by clients to store callback information. The standard requires the server to send a Set-CookieHTTP header to any HTTP request as a corresponding part, which contains the callback information. The browser stores such re ...

Posted by elenev on Mon, 30 Mar 2020 22:32:31 -0700

Menu tree structure implemented by vue.js and element UI

Due to business needs, it is required to implement tree menu, and the menu data is returned from the background. I found several articles on the Internet, and finally I have a solution. Reference article links at the bottom. Scenario: according to the business requirements, the active tree menu needs to be implemented. The menu data is returned ...

Posted by woodplease on Mon, 30 Mar 2020 22:26:42 -0700

Execution environment and scope, variable object, scope chain, closure

1: Execution environment and scope and variable object   var color = "blue";   function changeColor(){     var anotherColor = "red";     // Here you can visit color and another color   }   // Only color can be accessed here   changeColor(); Execution environment is the most important concept in javascript. Each execution env ...

Posted by rmmo on Mon, 30 Mar 2020 21:49:36 -0700

Using MathJax to display MathML and LaTeX formulas in web pages

MathJax is an open source JavaScript display engine for LaTeX, MathML, and ASCII math representations for all modern browsers. Display MathML MathML is a mathematical markup language. It is a standard based on XML (a subset of Standard General Markup Language), which is used to write mathematical symbols and formulas on the Internet. Some brows ...

Posted by tullmejs on Mon, 30 Mar 2020 10:26:48 -0700

Vue - - Nuxt.js for the whole family

1. Directory structure   2. Aliases On the vue page of nuxt.js, you can use ~or ~~ if you need to import resources from a directory such as assets or static.   3. Routing Nuxt.js automatically generates the routing configuration for the vue-router module based on the pages directory structure. To use routing between pages, we recomm ...

Posted by nemesis.2002 on Sun, 29 Mar 2020 19:53:29 -0700

Create JS: you have many colors

Game introduction: see you have polychrome "is a small game based on Html5 technology, which challenges the human eye's ability to distinguish colors and is fun and easy to use. According to Kaiser, the developer, the inspiration of the game is from the familiar game of finding fault, which is simplified according to the user's behavior ha ...

Posted by poison on Sat, 28 Mar 2020 08:31:44 -0700