English 中文(简体)
如何在Facebook上检查未界定的 Java印价值?
原标题:How to check an undefined JavaScript value in Facebook?

在通常的贾瓦文中,我可以检查一下。

if (i == undefined)

or

if (i === undefined)

或“类型”。

但是,在Facebook中,它将有api_key作为预设文件附后,未作界定。

也就是说,它将会变成

if (a12345_i == a12345_undefined)

NOT没有定义。

因此,如果变数不明确,我可以做些什么?


诚然,由于所有答复,但我认为我应当强调一点。 在 Java的正常环境中,我没有发现无效价值的问题。 问题一面是用Facebook作为

问题回答

恢复体力的类型,应检查:

typeof(var) ==  undefined 

......

if (i == null) or if (i === null)
if (i ==   ) or if (i ===   )

您可使用<条码>x = = 无,对<条码>null或<条码>未界定进行检查。 然而,你应当做的检查。 虽然a12345_un definedtt look喜欢un defined,但它是这样。 例如,这也将发挥作用:

var notDefined;
if (x === notDefined) { // ...

只要你从未将任何东西转让给变式<代码>unfin (改为a12345_un defined) <代码>un Defin is only a norm changings in Javacast, it onlystarts with un specified Value. 您可使用任何变量,而不作为<代码>未界定的比较值。

希望是有意义的。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签