修改跳转页面的href设置方式

This commit is contained in:
zhl 2023-04-17 11:29:10 +08:00
parent 7d3d28d2c6
commit aa797a0347

View File

@ -35,7 +35,8 @@
// if current devices is mobile, redirect url1, else redirect url2
if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
url = urlMobile
document.getElementById('href').attr('href', url)
console.log(url)
document.getElementById('href').setAttribute('href', url)
} else {
location.href = url
}