Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不用window.open打开新窗口 #61

Open
artdong opened this issue Jun 23, 2020 · 1 comment
Open

不用window.open打开新窗口 #61

artdong opened this issue Jun 23, 2020 · 1 comment
Labels
js javascript

Comments

@artdong
Copy link
Collaborator

artdong commented Jun 23, 2020

不用window.open打开新窗口

@artdong
Copy link
Collaborator Author

artdong commented Jun 23, 2020

方案一:

function openNewWindow(url) {
    let form = document.createElement('form');
    form.action = url;
    form.target = '_blank';
    form.method = 'POST';
    document.body.appendChild(form);
    form.submit();
}

@artdong artdong added the js javascript label Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
js javascript
Projects
None yet
Development

No branches or pull requests

1 participant