0

I am getting this error from a jquery script on a specific page which performs an ajax call... and as far as I know it is generally an error caused by a missing } or )... but I have looked through the code over and over again and cannot see anything that is missing. Are there any other possible reasons this error could be flagged?

 $('#socialMedia img').click(function() {
            var id = $(this).prop('id').toLowerCase();
            $.ajax({
                    url: "./socialMedia/" + id + ".php",
                    success: function(msg) {
                            $('.socialLink').css('opacity', '0.4');
                            $(this).css('opacity', '0.9');
                            if ($('#Feed').css('display') != 'none') {
                                    $('#Feed').slideToggle(400, function() {
                                            $('#Feed').html(msg);
                                    });
                            }
                            else
                            {
                                    $('#Feed').html(msg);
                            }
                            $('#Feed').slideToggle(400);
//                              if ($('#'+id+'Script').length <= 0) {
//                                      $('head').append('<script type="text/javascript" src="./script/' + id + '.js" id="'+id+'Script"></script>');
//                              }
                            //alert(msg);
                    }
            });
    });

EDIT: you can "see" (you won't actually see anything as the error causes the page never to be loaded) the page by going to http://www.luketimoth.me... and then clicking "contact.me" (it is an AJAX site, and I have not yet implemented any handling of url specifiers)

4

1 回答 1

1

问题出在此 URL 的 AJAX 响应中:

http://www.luketimoth.me/pages/contact.me.php

结束 </script> 标记实际上导致该脚本部分的结束 - 双斜杠注释语法适用于 javascript,HTML 解析器不尊重它并在此处结束脚本部分。

于 2013-08-04T19:17:48.310 回答