我想要显示,通过URL的JavaScript



我想显示这个,但它不起作用,帮助我。

document.write('<a href="/site"><img src="" alt="image"/></a> var answer = 
confirm ("Please click on OK to continue loading my page, or CANCEL to be 
directed to the Yahoo site.")
if (answer)
window.location="https://www.google.co.in";');      

文档和脚本是如此不同。 如果您在访问页面时打开确认,则可以这样做。

<script>
window.onload = function() {
var answer = confirm ("Please click on OK to continue loading my page, or CANCEL to be directed to the Yahoo site.");
if (answer) window.location="https://www.google.co.in";
}
</script>

最新更新