gpt4 book ai didi

javascript - 如何在javascript中使用href?

转载 作者:行者123 更新时间:2023-11-30 12:51:20 25 4
gpt4 key购买 nike

<label>
<input type="button" onclick="abc()" id="log" value='SUBMIT'>
</label>
<script>
function abc() {
google.script.run.withSuccessHandler(callback).processForm(document.forms[0]);
}

function callback(ste) {
if (ste == "true") {
var a = document.getElementById('log');
document.write(a.value);
document.write('<a href="http://www.w3schools.com/js/js_htmldom_html.asp">do stuff</a>');
} else document.write("false");
}
</script>

因为我正在使用 document.location && window.location 两者都无法切换页面,是否有任何其他方法可以帮助我

最佳答案

你可以使用

 window.location.href

关于javascript - 如何在javascript中使用href?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20857847/

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