gpt4 book ai didi

javascript - 覆盖点击事件不起作用

转载 作者:行者123 更新时间:2023-12-03 10:25:09 26 4
gpt4 key购买 nike

我正在尝试覆盖following domain上的一些点击事件但这行不通。单击通话按钮后,它将打开一个对话框,其中有一个应用按钮,我想在单击该按钮时转到其他网站,现在单击该按钮后它会打开另一个对话框。我使用以下代码来覆盖点击事件,但它不起作用。

    <!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title>My Website</title>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type='text/javascript'>
/* <![CDATA[ */
var soload = {"lang":"en","dir":"LTR","cookieOptions":{"domain":".hellobrokers.com"},
"packages":{"Clock":{},
"RegularPlatform":{"settings":{"selector":"#so_container"}}
}};
/* ]]> */
</script>
<script type='text/javascript' src='//spotplatform.hellobrokers.com/SpotOptionPlugin.js?ver=4.1.1'></script>
<script type="text/javascript">SO.load(soload);
</script>
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6022904954366', {'value':'0.01','currency':'EUR'}]);
</script>
</head>
<body>
<div id="bgbanner">
<div id="index">
<div class="mainContent">
<div id="so_container">
<div align="center" class="please_wait">
<img border="0" src="img/ajax-loader.gif" alt="" /><br />
<br />
Please Wait<br />
<br />
Loading</div>
</div>
</div>
</div>
</div>

<script>
$(document).ready(function() {
$('.applyApprove').unbind();

$(".applyApprove").click(function() {
window.location = 'http://www.google.com';
});
});
</script>
</body>
</html>

最佳答案

使用 .off('click') 而不是 .unbind(),它应该可以工作:

<script>
$(document).ready(function(){
$("button.applyApprove").off('click');

$("button.applyApprove").click(function(){
window.location = "http://www.google.com";
});
});
</script>

关于javascript - 覆盖点击事件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29440082/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com