打开两个窗口的onClick按钮javascript [英] Open two windows onClick button javascript

查看:67
本文介绍了打开两个窗口的onClick按钮javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过单击一个按钮来打开两个不同的窗口,但是当我单击该按钮时,它将两次打开同一个窗口.这是我的功能:

I am trying to open two different windows with the click of a button, but when i click the button it opens the same window twice. This is my function:

function flush(form) {
    var custid = form.custid.value;
    var url1 = "https://www.blabla.com?type=customer&id="+custid;
    flushWindow1 = window.open(url1);
    var url2 = "https://web.blabla.com?type=customer&id="+custid;
    flushWindow2 = window.open(url2);
}  

有人知道我该怎么做吗?

Does anyone know how I can do this?

推荐答案

来自: JSfiddle单击两个窗口

$('document').ready(function(){
    $('input').click(function(){
        window.open("https://www.google.com.pk/search?q=123&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a")
        window.open("https://www.google.com.pk/search?q=abc&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a")
    });
});  

这篇关于打开两个窗口的onClick按钮javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆