The problem of js path is sometimes difficult to deal with. In jsp, we can use el expression to directly obtain basePath, but el expression cannot be used in a separate js file, and we do not want to write a separate variable in jsp. You can use the following Method: