<script type="text/javascript">
function locationTest(){
var h_assign=location.assign('https://developer.mozilla.org/zh-CN/docs/Web/API/Location/assign');
document.write("返回新的文档方法:"+ h_assign);
var h_pathname=location.pathname;
document.write("<br>" + "返回URL路径:"+ h_pathname );
}
</script>
<input type="button" value="按钮" onclick="locationTest()">
location.assign()是加载网页。。没有返回值吧?
顺序调换,你确定能运行?