未捕获的ReferenceError:未定义e [英] Uncaught ReferenceError: e is not defined

查看:140
本文介绍了未捕获的ReferenceError:未定义e的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此代码中:

in this code :

m.port1.onmessage = function (e) {

alert(e.data);
                                 }



我想要完成定义!

这样的考试:



而(e == define)

{

//做更多

}


i want done wen e is defined !
for exam like this :

while (e == define)
{
//do more
}

推荐答案

您可以使用此代码来验证变量是否已定义(或未定义)< br $> b $ b

You can use this code to verify that a variable is defined (or undefined)

// In your case instead of "variable" you will of course use "e"
if (typeof variable === 'undefined') {
    // variable is undefined
}





干杯,

C



Cheers,
C


这篇关于未捕获的ReferenceError:未定义e的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆