


Solution to the problem of window.location not jumping_javascript skills
I encountered a problem when writing code today: the onclick event is used in HTML to realize the jump of window.location = url, and the href="javascrit:;" attribute is added to the embedded element. At this time, the jump to window.location fails. Later, I checked on the Internet, and I remembered that events in JavaScript are bubbled, which may be blocked by the embedded href event.
The solution is: add a return false statement in the onclick method to force the program to jump out and not continue to execute the following statements.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

First, let me briefly introduce the types of location and matching rules, using the example of nginxwiki as an example: location=/{#matchesthequery/only.[configurationa]}location/{#matchesanyquery,sinceallqueriesbeginwith/,butregular#expressionsandanylongerconventionalblockswillbe#matchedfirst.[ configurationb]}location^~/im

Note: The root and aliasroot instructions in location only set the search root to the directory set by root, that is, the uri will not be truncated. Instead, the original uri will be used to jump to the directory to find the file. The aias instruction will truncate the matching uri, and then Use the path set by alias plus the remaining uri as a sub-path to find the uri of proxy_pass in location. If the url of proxy_pass does not have uri, if the tail is "/", the matching uri will be truncated. If the tail is not "/", then Will not truncate the matching uri if the proxy_pass url contains uri

Location tutorial example: location=/{#Exact match/, the host name cannot be followed by any string [configurationA]}location/{#Because all addresses begin with /, this rule will match all requests#But regular and the longest string will be matched first [configurationB]}location/documents/{#Match any address starting with /documents/. After matching, continue to search downwards#Only when the subsequent regular expression is not matched, This article will use [configurationC]}location~/document

1. Introduction The location directive is the core configuration of the http module. It receives requests sent by users based on predefined URL matching rules. Based on the matching results, the request is forwarded to the backend server. Illegal requests are directly rejected and return 403. 404, 500 error handling, etc. 2. Location instruction syntax location[=|~|~*|^~|@]/uri/{…} or location@name{…} 3. URI matching mode The location instruction is divided into two matching modes: 1> Ordinary characters String matching: rules starting with = or without leading characters (~) 2> Regular matching: starting with ~ or ~* indicates regular matching, ~*

Grammar location[=|~|~*|^~]/uri/{...} Rule=: Indicates exact uri matching (interested students can take a look at the difference between url and uri)~: Indicates case-sensitive Regular matching~*: Indicates case-insensitive regular matching!~&&!~*: Indicates case-insensitive non-matching regular and case-insensitive non-matching regular /: Universal matching, any request will be matched to the location match The target location matching test only uses the request uri part, not the parameter part. (Reason: There are too many ways to write parameters and cannot be matched accurately) On the premise of multiple location configurations in the location matching sequence,

Server matching logic When nginx determines which server block to execute a request, it mainly focuses on the listen and server_name fields in the server block. The listen command listen field defines the IP and port of the server response. If the listen field is not explicitly configured, the default listening 0.0.0.0:80 (root) or 0.0.0.0:8080 (non-root) listen can be configured as: a combination of ip and port, a single ip, listening on port 80 by default, a single port, and listening on all ip interfaces by default A unixsocket path where the last entry is usually only used in different

Pre-test access domain name: www.test.com/api/upload1.location and proxy_pass both contain /, then the real address without location matches the directory location/api/{proxy_passhttp://127.0.0.1:8080/;} access address :www.test.com/api/upload-->http://127.0.0.1:8080/upload2.location does not contain /, proxy_pass contains /, then the real address will contain /location/api{proxy_passhttp:/

Detailed explanation of nginxlocation matching examples Example 1, nginx configuration: Example 2, nginx configuration: Example 3, nginx configuration:
