標籤:
先看看下面的代碼,圖片是用notepad++寫的,上面下面兩段代碼一摸一樣,但是下面就是報錯
開始感覺是不是變數名的問題,結果發現不是
對於這種奇葩的問題,我只能貼出代碼,無可奈何!!!
<html><head><title>javascript</title> <script type="text/javascript"> function f1(){ var n = 999; alert(n); } f1(); </script> <script type="text/javascript"> function f2(){ var m = 999; alert(m); } f2(); </script></head></html>
如果有高人在的話,能解釋一下嗎?
結果發現,在 notepad++ 裡面的顯示有一點點不同:
最後果斷的選擇報錯的行前面的空格,刪了,再打三個tab鍵:
出現了,神一般的虛線:
問題居然出在代碼前面的空白字元,這段代碼本來是用 UltraEdit 編輯器編輯的,額,如果你什麼時候出了和我一樣的問題,這或許可以解救你!
錯誤碼貼一下:
axError: Unexpected token ILLEGAL
element
| Font |
| font-family |
|
| font-size |
|
| font-style |
|
| font-variant |
|
| font-weight |
|
| letter-spacing |
|
| line-height |
|
| text-decoration |
|
| text-align |
|
| text-indent |
|
| text-transform |
|
| white-space |
|
| word-spacing |
|
| color |
|
| Background |
| bg-attachment |
|
| bg-color |
|
| bg-image |
|
| bg-position |
|
| bg-repeat |
|
| Box |
| width |
|
| height |
|
| border-top |
|
| border-right |
|
| border-bottom |
|
| border-left |
|
| margin |
|
| padding |
|
| max-height |
|
| min-height |
|
| max-width |
|
| min-width |
|
| outline-color |
|
| outline-style |
|
| outline-width |
|
| Positioning |
| position |
|
| top |
|
| bottom |
|
| right |
|
| left |
|
| float |
|
| display |
|
| clear |
|
| z-index |
|
| List |
| list-style-image |
|
| list-style-type |
|
| list-style-position |
|
| Table |
| vertical-align |
|
| border-collapse |
|
| border-spacing |
|
| caption-side |
|
| empty-cells |
|
| table-layout |
|
| Effects |
| text-shadow |
|
| -webkit-box-shadow |
|
| border-radius |
|
| Other |
| overflow |
|
| cursor |
|
| visibility |
|
javascript axError: Unexpected token ILLEGAL 很簡單的代碼,但是無法解釋的錯誤