San*_*osh 4 html javascript jquery
我有一个 url,可以说www.myurl.com/mywebpage,当我在浏览器中输入这个 url 时,它会打开我的页面,一切正常。
现在我的要求是,当我在浏览器中输入这个 url 时,网页应该像弹出窗口一样打开。由于没有按钮单击或此类事件,我无法编写window.openjavascript 函数来打开它作为弹出窗口。
有没有其他方法(jquery)或我们如何使用 window.open 函数在浏览器中点击 url 时将我的页面显示为弹出窗口。
提前致谢。
仅在 html 中使用 window.open(没有任何功能)就解决了我的问题。
在 page1.html 我写了以下脚本
<script>
window.open("http://google.com", "myWindow", 'width=800,height=600');
window.close();
</script>
Run Code Online (Sandbox Code Playgroud)
当我在浏览器地址中输入 page1.html 时,它会以弹出窗口的形式打开谷歌页面。
感谢大家为帮助我所做的努力。