错误在路易斯安那州经济发展的广告?路易斯安那州、经济发展、错误、广告

由网友(℡年少无知轻狂酒吧闯ζ)分享简介:我读了2011年6月发行Wired杂志的一天,我遇到了一个广告为路易斯安那州经济发展,presumably ActionScript编写。 I was reading the June 2011 issue of Wired magazine the other day, and I came across an a...

我读了2011年6月发行Wired杂志的一天,我遇到了一个广告为路易斯安那州经济发展,presumably ActionScript编写。

I was reading the June 2011 issue of Wired magazine the other day, and I came across an ad for Louisiana Economic Development, presumably written in ActionScript.

我本来以为这是一个聪明的广告,但看进去后,似乎有在code相当明显的bug。

I originally thought that it was a clever ad, but after looking into it, it seems like there's a fairly obvious bug in the code.

难道只是我,或者应该破发返回

Is it just me, or should that break be a return?

推荐答案

我把它称为一个错误,因为理想的结果很可能是导航到该URL,如果这些利益中的任何一个被保持,如果什么都不做他们都不是。因此,我会改变的逻辑如下(暂时忽略从scriptocalypse注释中提到的问题):

I'd call it a bug, since the desired outcome would most likely be to navigate to the URL if any one of those interests is held and do nothing if none of them are. As such, I would change the logic to the following (ignoring for the moment the issues mentioned in the comment from scriptocalypse):

if (this.innovator.hasInterestIn(interest[i])){
    navigateToURL("www.OpportunityLouisiana.com/digital");
    return;
}

当然,

,这不会看起来不错的广告,因为该URL不会在显着的code底部显示。也许是一个更好的选择是将组织的逻辑是这样的循环:

Of course, this wouldn't look as good in an ad, since the URL wouldn't be prominently displayed at the bottom of the code. Perhaps a better alternative would be to organize the logic in the loop like this:

if (this.innovator.hasInterestIn(interest[i])){
    break;
} else if (i == n-1){
    return;
}
阅读全文

相关推荐

最新文章