小编ris*_*pta的帖子

当我尝试一个接一个地调用我的注册协议时,只有一个可以随机调用

  1. 我已经注册了两个协议.
  2. 当我尝试在同一事件中调用两个协议时,在Chrome浏览器中一次只能调用一个协议.

$(function () {
    $("div[href]").click(function (event) {
        debugger;
        //for validation purpose.
        window.location = "abcd:";

       //if it is validated then
        window.location ="xyz:";



    });
});
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>Custom Protocol Detection</title>
</head>

<body id="abcd">
    <h1>Click one of these labels:</h1>
    <a href="#" id="atemp"></a>
    <div href="blahblah:randomstuff"  style="background-color:aquamarine">
        Non-exist protocol
    </div>
    <div href="mailto:johndoe@somewhere.com" style="background-color:aqua">
        Send email
    </div>
    <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>   
    <script src="example.js"></script>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

  1. 请让我知道如何在同一事件中调用这两个协议.

html javascript google-chrome custom-protocol

8
推荐指数
1
解决办法
232
查看次数

标签 统计

custom-protocol ×1

google-chrome ×1

html ×1

javascript ×1