1、打开新窗口
//第一种
getNewsDetail(url){
var tempwindow=window.open('_blank');
tempwindow.location=url;
}
//第二种
getNewsDetail(url) {
window.open(url, "_blank");
}
//第三种
getNewsDetail(url){
var link = document.createElement('a');
link.href = url;
link.target="_blank"
document.body.appendChild(link);
link.click();
}
2、在当前窗口打开
//第一种
getNewsDetail(url){
window.location=url;
}
//第二种
getNewsDetail(url){
window.location.href=url;
}
//第三种
getNewsDetail(url){
var link = document.createElement('a');
link.href = url;
document.body.appendChild(link);
link.click();
}