javascript - Says "Expecting more source characters" - Stack Overflow

That code below gives an error "Expecting more source characters" you may please any help me

That code below gives an error "Expecting more source characters" you may please any help me on this issue.

Thanks

Cengiz Yücel A web developer form Turkey

 <script type="text/javascript">
        $(document).ready(function () {
            $("a#aDevam").hover(function () {
                $("div#SekmeBtn").css({ 'background-image': 'url(images/SekmeButonDevam.jpg)'
                });
            }, function () {
                var cssObj = { 'background-color': '#ddd' }
                $("div#AA").css(cssObj);
            });
 </script>

That code below gives an error "Expecting more source characters" you may please any help me on this issue.

Thanks

Cengiz Yücel A web developer form Turkey

 <script type="text/javascript">
        $(document).ready(function () {
            $("a#aDevam").hover(function () {
                $("div#SekmeBtn").css({ 'background-image': 'url(images/SekmeButonDevam.jpg)'
                });
            }, function () {
                var cssObj = { 'background-color': '#ddd' }
                $("div#AA").css(cssObj);
            });
 </script>
Share Improve this question edited Feb 18, 2011 at 9:25 user241244 asked Feb 18, 2011 at 9:15 Cengiz YücelCengiz Yücel 11 silver badge1 bronze badge 0
Add a ment  | 

3 Answers 3

Reset to default 5

"Expecting more source characters" normally indicates a line that's not terminated and there is one.

var cssObj = { 'background-color': '#ddd' }

needs a semicolon.

check unclosed braces or missed semicolon inside your java script snippet. I got this error whenever I missed a closing brace for a function inside the 'script' tag.

Another mon source that catches C programmers is the opening brace on functions -- (most) javascript programmers put it at the end of the line and (most) C programmers start it on a new line. Doing both is obviously an error:

MyClass.LastFunctionInFile = function() {
{
    Foo();
    Bar();
}

See it?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744696702a4588535.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信