Home Web Front-end JS Tutorial Solution to the problem of window.location not jumping_javascript skills

Solution to the problem of window.location not jumping_javascript skills

May 16, 2016 pm 04:52 PM
location

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.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Analysis of location configuration examples in Nginx server Analysis of location configuration examples in Nginx server May 24, 2023 pm 02:05 PM

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

How to intercept uri in nginx location How to intercept uri in nginx location May 18, 2023 pm 12:07 PM

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

How to configure location and rewrite rules in Nginx How to configure location and rewrite rules in Nginx May 18, 2023 pm 12:25 PM

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

What are the Nginx Location directive URI matching rules? What are the Nginx Location directive URI matching rules? May 14, 2023 pm 11:58 PM

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, ~*

How to configure location in Nginx server How to configure location in Nginx server May 14, 2023 pm 07:16 PM

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,

What is the matching logic of Server and Location in Nginx? What is the matching logic of Server and Location in Nginx? May 12, 2023 am 11:10 AM

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

What is the difference between nginx location and proxy_pass What is the difference between nginx location and proxy_pass May 16, 2023 pm 03:16 PM

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:/

nginx location matching method nginx location matching method May 15, 2023 pm 02:25 PM

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

See all articles