vs里with语句alert打开后无弹窗

为什么打开网页后没有弹窗


```javascript
<script type = "text/javascript">
function Student(name,sex,age){
    this.name=name;
    this.sex=sex;
    this.age=age;
}
var student=new Student("周星星","男",26);
with(student)
{
alert("姓名:"+name+"\n 性别:"+sex+"\n 年龄:"+age);
}
</script>

alert("姓名:"+name+"\n 性别:"+sex+"\n 年龄:"+age) 之后的;号写成了中文全角的,要改成英文半角的。
你题目的解答代码如下:

function Student(name,sex,age){
    this.name=name;
    this.sex=sex;
    this.age=age;
}
var student=new Student("周星星","男",26);
with(student)
{
alert("姓名:"+name+"\n 性别:"+sex+"\n 年龄:"+age);  // 分号改成英文半角的。
}

img

如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!

img

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632