Home >Web Front-end >JS Tutorial >Problem with jumping page in javascript showModalDialog_javascript skills

Problem with jumping page in javascript showModalDialog_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:15:321142browse

After checking the code, I found that location is used in the jump link, but if the link generated by A is used directly, a new page will not pop up when clicking to jump.
Solution:
Use JS script to simulate clicking on a link like A without using location. Try it:

Copy code The code is as follows:

function go_link(url) {
var link = document.createElement("a");
link.href = url;
document.body.appendChild(link);
link.click();
}

Where location is called, call the go_link method instead.
Must cooperate with

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