Invalid Character Error

分类:Javascript| 发布:camnprbubuol| 查看: | 发表时间:2011/8/18

I get the following error message:

Line: 2
Char: 1
Error: Invalid character
Code: 0

I remember running the page in question without any error messages in the past. Moreover, the line in question contains no JavaScripting.

What is the cause of this error and how can it be avoided?

This error seems to be quite unspecific. Now I receive it when I place a page in a frameset. When the page is run directly, not from within the frameset, no error message appears. Any ideas why this happens? The page in question is different from the above example.

P.S. The problem seemed to be again missing javascript source in the newly generated html source. It’s interesting that both the standalone and the frameset versions reported the error when I uploaded them to the above URL. Only the frameset version gives the error when the files are tested from my drive.

问题代码:<a onclick="getCityList(0,\"\");" href="#">中国</a>

造成原因:

这意味着您的JavaScript不是“良好的形成”,并给一个JavaScript错误,如果它遇到一个字符,它是不希望或在错误的地方。一些常见的无效字符包括: \ / .. <>#%&“’ 你会后一个链接页面或复制到一个新的人职位的问题的代码时,一 看电话 。

正确代码:<a onclick="getCityList(0,’’);" href="#">中国</a>

365据说看到好文章不转的人,服务器容易宕机
原创文章如转载,请注明:转载自郑州网建-前端开发 http://camnpr.com/
本文链接:http://camnpr.com/archives/409.html