js判断网页是localhost还是服务器 csdn

2025-04-26 06:30:00
推荐回答(1个)
回答1:

if (window.location.host=="127.0.0.1" || window.location.host=="localhost" ){
alert( "hostis local");

}