PHP:Button控件的新窗口打开
PHP中,通过Button控件的onClick()事件打开网页的方式有很多。
比如下面的这两种:
location.href=’xxxxxx’
1 2 |
<input type="button" value="本站地图(Sitemap)" onclick="location.href='http://d-prototype.com/sitemap.html';"/> |
网页在当前页面打开。
window.open(‘xxxxxxxxx’)
1 2 |
<input type="button" value="本站地图(Sitemap)" onclick="window.open('http://d-prototype.com/sitemap.html');"/> |
网页新开窗口打开。
——————————————————
Done。