开发者

Why Aptana is accusing an error in this code?

开发者 https://www.devze.com 2023-01-13 03:10 出处:网络
I copied this page\'s source in Aptana IDE for javascript. But, in the last lines: <script language=\"JavaScript\">

I copied this page's source in Aptana IDE for javascript. But, in the last lines:

                        <script language="JavaScript">
                            init();
                        </script>
                    &l开发者_StackOverflowt;/body>
                    </html>

it is showing at the init() line: syntax error, why? (when run, it works correctly)


There's a missing semicolon. Change

<input type="reset" onclick="lines=0;return true">

to

<input type="reset" onclick="lines=0;return true;">


Change it to

<script type="text/javascript">


I cannot reproduce this. Copy/pasting the code from that page into Aptana does not give me any errors. Make sure that a) you have the latest version of Aptana, and b) there are not any strange cop/paste artifacts in your code. Try pasting to notepad first and then from there to Aptana, to remove formatting information and see if it make a difference.

Why Aptana is accusing an error in this code?


If you copy/pasted maybe the editor is with invalid characters, try checking for " or ' and replacing them with regular quotes and doboule quotes.

Copy Pasting source codes ofter cause this problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消