[英]Insert string to button onclick location.href Javascript
[英]bootstrap button onclick and location.href
有什么理由不行吗?
<button class="btn btn-primary btn-lg" onClick="location.href='http://anothersitehere.com/file.pdf'">Download PDF</button>
你会尝试使用它
<a class="btn btn-primary btn-lg" href="http://anothersitehere.com/file.pdf">
Download PDF
</a>
将location.href
留空并在javascript函数中给出
document.location.href='page.php?variable='+value;
它将重定向到您想要的页面。
它似乎正在努力转向链接。 我正在使用Chrome btw。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.