Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/446.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从变量-JS/Jquery打开带有后缀的URL_Javascript_Jquery_Html_String - Fatal编程技术网

Javascript 从变量-JS/Jquery打开带有后缀的URL

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

$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,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,现在修好了,还有更好的吗?