SSブログ

[Note] スクリプトに繊細な IE - IE is delicate to a script [Internet Explorer]

IE の JavaScript エンジンが、連想配列の最後の要素の後のコンマでエラーになることは有名ですが。

It is famous that the script engine of the IE disallow the comma (,) after the last element of an associative array.

今回は、違うパターンでハマった話です。

This article is about a trouble in another pattern.

つい先日、はじめて ASP.NET AJAX 対応の ユーザー コントロールを作りました。

A few days ago, I created an user control of ASP.NET that supported ASP.NET AJAX client framework, for the first time.

そこで、どうにも納得できない状態になりました。

And I faced the trouble that I couldn't understand.

aspx マークアップ内のスクリプト ブロックに書いた特定のスクリプトが反応しないんです。

The specified script in the script block of an aspx markup did not work.

Visual Studio デバッグ実行のときは問題なく動いていたのに、デプロイしたら動かないんです。

It had worked in the Visual Studio debug running, but it did not work after deploying.

せめて IE がエラーを出してくれれば問題を見つけやすいのですが、なにも言ってくれない。

I was sure that I could find the problem faster if IE told me something about the error, but the IE told me nothing.

さんざん調べてみたんですが、決定的な原因は見つからず。

I looked for the decisive cause of the trouble badly, but I couldn't.

でも、何行か文末にセミコロン(;)がない行が見つかって、気持ち悪いから直してみたら…。

By the way, I found some script lines had no semicolon (;) at the end of line, and modified it ...

動きました。

It worked.

そんな理由?

Was it caused by such a reason?

『最後のコンマ』の場合は、IE がエラーで教えてくれるから、まだ助かります。

The IE tells me about the "last comma" as an error, I'll notice it.

今回の『セミコロンの欠落』は、なにも教えてもらえなかっただけに、何時間も無駄にしました。

In this case "lost semicolon", I wasted much time because IE told me nothing.

気をつけよう。

I'll be careful in future.


この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。