Javascript 从变量-JS/Jquery打开带有后缀的URL
$dash=www.dashboard.com $name=我的测试面板Javascript 从变量-JS/Jquery打开带有后缀的URL,javascript,jquery,html,string,Javascript,Jquery,Html,String,$dash=www.dashboard.com $name=我的测试面板 <input type="button" class="button" value="button" onclick="window.open('$dash + $Name')"/> <script>onclick="window.open(this.href,'popUpWindow','height=400,width=600,left=10,top=10,,scrollbars=yes,me
<input type="button" class="button" value="button" onclick="window.open('$dash + $Name')"/>
<script>onclick="window.open(this.href,'popUpWindow','height=400,width=600,left=10,top=10,,scrollbars=yes,menubar=no'); return false;"</script>
当我点击按钮时,我想打开以下URL
www.dashboard.com/My%20Test%20Panel
我上面的代码不好:只需将字符串连接在一起:
<input type="button" class="button" value="button" onclick="window.open(`${$dash}${$name}`)"/>
你把这封信弄错了
你可以用这个
<input type="button" class="button" value="button" onclick="window.open($dash + $name)"/>
是的,我试过了,它什么也打不开!至少在“打开”的地方。哦,我的坏@LukeToss,现在修好了,还有更好的吗?