current position:Home>[front end learning notes] save the front-end related codes
[front end learning notes] save the front-end related codes
2022-04-29 07:53:26【Micro love】
- Get the of the deployment project root Address
// Get the project url route
function getRootPath() {
// 1、 Get the current full path , Such as : http://localhost:8080/springmvc/page/frame/test.html
let curWwwPath = window.location.href;
// Get the current relative path : /springmvc/page/frame/test.html
let pathName = window.location.pathname;
// Get the host address , Such as : http://localhost:8080
let local = curWwwPath.substring(0, curWwwPath.indexOf(pathName));
// Get the belt "/" The project name , Such as :/springmvc
let projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
//http://localhost:xxxx/ Project name
return local + projectName;
}
// webapp The path of http://localhost:xxxx/ Project name /
// window.location.href = getRootPath() + "/pages/index.html";
copyright notice
author[Micro love],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204290548191314.html
The sidebar is recommended
- Which one charges less for opening a securities account and how to open the account
- Spring MVC notes 02 domain object sharing data, view, restful, httpmessageconverter, file upload and download
- Httpclient setting timeout
- Command line / Python uses pdf2htmlex to convert PDF to HTML
- [front end three swordsmen III] analysis of JavaScript scalpel Part II
- How to choose the front-end learning path
- Finite element parametric element, calculation, theoretical problems
- Handwritten CSS modules to understand its principle
- Front end browser debugging tips
- Performance problem analysis guide for enterprise JavaScript applications running in production systems
guess what you like
CSS aspect-ratio All In One
Actual combat of vue3 project --- Zhihu daily --- details page
Actual combat of vue3 project --- Zhihu daily --- home page function
Great Wall Motors is falling endlessly! The boss has lost 150 billion yuan in half a year, and the performance of the new energy sector has improved
Nginx tips batch shutdown process
Openresty introduces nginx_ upstream_ check_ Module module
Nginx multiple servers_ How does name match
Why does the front end still prompt cannot post, and the error reported by the back end still prompt null pointer?
HTML Li set margin: 50%, but the width of the outermost div is the standard
Are there any specific steps to create a prototype, such as JavaScript?
Random recommended
- How does HTML5 display the value obtained from the database in the specified area
- Problems related to nginx rewriting interface
- What happens when you open a CSS file in eclipse without responding
- React download local template can be downloaded locally, but the deployment online download is blank
- @Babel / traverse official example running error: typeerror: traverse is not a function
- The click event of jQuery has no effect
- How to learn from non professional background?
- Usage of API documented as @since 1.8+ less... (Ctrl+F1) Inspection info: This inspection finds all
- Configuration Vue of webpack
- Introduction to nginx (learning notes)
- Is the financial management class of qiniu school true? Can you learn how to manage money in free lessons
- How does Java randomly get elements from a list
- Use of Vue on in Vue
- Use of Vue router
- Vue basic syntax
- Use of webpack
- Vue diff algorithm
- CSS -- Text gradient from top to bottom
- Routing: Vue router
- Leetcode 658. Find K closest elements
- How to configure Vue in Vue project config. JS to solve cross domain problems
- Centos6 makes nginx-1.21.6-rpm package -- the way to build a dream
- [vue2-sgg v] vuex
- [vue2-sgg vi] route Vue router guard
- [vue2-sgg VII] Vue export and deploy to nginx --- UI component library (element UI...)
- Chapter 12 Ajax
- Clion remote debugging ubutun server, blood lessons
- The latest vue-i18n international plug-in realizes language switching (with source code)
- Vue monitors watch usage
- Vue encapsulates Axios to the full version of the calling interface (code source code)
- Watch data monitoring in Vue and detailed explanation of various attributes in watch
- Vue encapsulates Axios to call interface Full Version (code source code) latest recommendation (II)
- Vue encapsulates Axios to the full version of the calling interface (code source code)
- Ajax usage based on JQ
- Vue project optimization
- Vue - form generator form code generation
- Data acquisition in vuex is assigned to the local problem, and when is vuex data assigned to the local problem
- The modal box component is encapsulated in Vue, and the animation effect in Vue
- Swiper, the application of swiper in Vue, and various versions of swiper are applied in Vue projects
- Python——ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org‘, port=443)