我希望能够更改页面的地址,但在进行更改时不会发出任何HTTP请求.如何使用JavaScript完成?
我用javascript有点麻烦.
这是搜索框:
<input id="lala" onkeypress="lala(event)" />
Run Code Online (Sandbox Code Playgroud)
这是脚本:
<script type="text/javascript">
function lala(e){
tecla = (document.all) ? e.keyCode : e.which;
if(tecla==13) windows.location.href = 'http://server:100/Theme/resumenInstrumento.aspx?nemo=lan';
}
</script>
Run Code Online (Sandbox Code Playgroud)
什么时候做一个javascript警报,它看起来很好,但我不能去URL.
我需要能够检查以下内容:
$(".main-menu a")
对于特定href属性然后addClass
我正在尝试打开外部 URL,但它不是在新选项卡中打开www.google.com ,而是打开http://localhost:3001/www.google.com
<IconButton key={index} size="large" color="primary" href={e.url} target={"_blank"} aria-label="menu" style={{zIndex:100}} >
<img style={{width:'30px', height:'30px', maxHeight:'30px', maxWidth:'30px'}} href={e.url} target="_blank"
src={icon}/>
</IconButton>
Run Code Online (Sandbox Code Playgroud)