Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试获取$.get时出现Javascript错误_Javascript_Jquery - Fatal编程技术网

尝试获取$.get时出现Javascript错误

尝试获取$.get时出现Javascript错误,javascript,jquery,Javascript,Jquery,这就是我在chrome开发者控制台中遇到的错误 Uncaught TypeError: Object #<Comment> has no method 'querySelectorAll' tviggr.content.dev.js:3094 that.proccessNode tviggr.content.dev.js:3094 (anonymous function) tviggr.content.dev.js:3212 p.event.dispatch tviggr.conte

这就是我在chrome开发者控制台中遇到的错误

Uncaught TypeError: Object #<Comment> has no method 'querySelectorAll' tviggr.content.dev.js:3094
that.proccessNode tviggr.content.dev.js:3094
(anonymous function) tviggr.content.dev.js:3212
p.event.dispatch tviggr.content.dev.js:2
g.handle.h tviggr.content.dev.js:2
(anonymous function) jquery.js:6163
x.extend.access jquery.js:861
x.fn.extend.html jquery.js:6138
(anonymous function) pages.js:41
c jquery.js:3048
p.fireWith jquery.js:3160
k jquery.js:8235
r

我在这里找鞍衣,但我没有找到,所以我才把它贴出来。

我刚刚发现了。这是tviggr扩展的一个问题@巴尔马是对的,但为了消除这个错误,我不得不删除它。因此,我的浏览器出现了问题。

mainContent的HTML是什么样子的?错误似乎来自tviggr扩展。如果你禁用它会发生什么?@jfriend00看起来是这样的

@Barmar什么都没有发生,但我忘了告诉你的是,我有4个这样的函数,只有当我运行这个函数时才会显示错误。哪一行是pages.js的第41行?错误发生在
.html()
调用中,但它是
$('title').html()
还是
$('mainContent').html()
function nHome(){
    if(currentSiteUrl!="pages/home.php" && switchProcess==false){
        //Translation and variables stuff.
        switchProcess = true;
        $('#mainContent').fadeTo(200,0.0001);
        //Page loading stuff.
        setTimeout(function(){$.when($.ajax(
            {
                url:"pages/home.php",
                cache:false,
                success: function(pagesData)
                {
                    content = pagesData;
                    $('title').html('Home - kamillozz7k');
                    //Setting var for current site
                    currentSiteUrl = 'pages/home.php';
                }
            })).done(function(){
                $('#mainContent').html(content);
                $('#mainContent').fadeTo(500,1);
                setTimeout(function(){switchProcess = false;},300);
            });
                             },200);
    }
}