Javascript <;a>;href concat自己的域加上另一个域
当单击此按钮时,将加载: http://localhost:3000/www.anotherwebsite.net 我如何加载Javascript <;a>;href concat自己的域加上另一个域,javascript,reactjs,Javascript,Reactjs,当单击此按钮时,将加载: http://localhost:3000/www.anotherwebsite.net 我如何加载 一个URL如果不是以/开头,或者不是方案相关的,则将被视为相对路径 在域前面加上http或https: <a href={'https://' + post.domain} ... Prepend protocol,例如http://或仅//使用当前页面的协议。 <a href={'https://' + post.domain} target=&quo
一个URL如果不是以
/
开头,或者不是方案相关的,则将被视为相对路径
在域前面加上http
或https
:
<a href={'https://' + post.domain} ...
Prepend protocol,例如http://
或仅//
使用当前页面的协议。
<a href={'https://' + post.domain} target="_blank" rel="noreferrer noopener">
Another Website
</a>
<a href={'https://' + post.domain} ...