I have the following javascript constant:
const url = 'www.google.com';
And I am trying to open it in a new window everytime someone selects the following link:
<a href={url} target="_blank">Google</a>
but instead I get:
localhost:8080/firstApp/index.html#https://www.google.com
尝试将“//”添加到您的网址中,如下所示:
const url = "//www.google.com";
您的网址应以http
或https
开头
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.