javascript axError: Unexpected token ILLEGAL 很簡單的代碼,但是無法解釋的錯誤

來源:互聯網
上載者:User

標籤:

先看看下面的代碼,圖片是用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 很簡單的代碼,但是無法解釋的錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.