Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/442.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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
Javascript 未捕获的TypeError:$.get不是位于<;的函数;匿名>;:1:3_Javascript_Jquery_Json_Google Chrome Extension_Manifest - Fatal编程技术网

Javascript 未捕获的TypeError:$.get不是位于<;的函数;匿名>;:1:3

Javascript 未捕获的TypeError:$.get不是位于<;的函数;匿名>;:1:3,javascript,jquery,json,google-chrome-extension,manifest,Javascript,Jquery,Json,Google Chrome Extension,Manifest,我正在处理修改youtube主页的Google Chrome扩展,我一直无法执行$.get jQuery函数。jQuery源代码包含在json文件中。完整错误消息为未捕获的TypeError:$。get不是函数 时间:1:3 我检查了我的jQuery源代码是否为精简版本。我的jQuery选择器似乎工作得很好,但当我尝试运行$.get()时,它表示它不是一个函数 //main.js file //code that works //removes the content from the page

我正在处理修改youtube主页的Google Chrome扩展,我一直无法执行$.get jQuery函数。jQuery源代码包含在json文件中。完整错误消息为未捕获的TypeError:$。get不是函数 时间:1:3

我检查了我的jQuery源代码是否为精简版本。我的jQuery选择器似乎工作得很好,但当我尝试运行$.get()时,它表示它不是一个函数

//main.js file
//code that works
//removes the content from the page and adds a quote and a picture
let content=$('#contents')
let contentParent = content.parent();
content.remove()
contentParent.prepend("<h1> Get back to achieving your dreams!!!</h1>")
$("h1").addClass("beautText")

//code that doesn`t work
$.get('https://picsum.photos/list', function(result) {
    // result is whatever the URL sends back from the request
    console.log(result)
  })

我希望在控制台中获得结果[Object,Object,Object…],但我收到一条错误消息,$.get()不是函数。我花了很多时间想弄明白为什么会这样,但我真的被卡住了。谢谢你的帮助

谢谢大家的评论。它似乎在别人的笔记本电脑上工作,但在我的笔记本电脑上不起作用。答案很简单,但我想说,以防任何人也会遇到问题:我在chrome工具中隐藏了控制台消息


我在“过滤器”窗口中键入了一些内容,它阻止了消息在控制台中弹出。

您使用的是哪个版本的jquery?你能给我们一个那个版本的URL吗?我在这里测试:嘿!谢谢你的回答。这是指向我使用的版本的链接:。我也尝试了最新的一个,但效果不太好。这只是因为无法按照发布的代码进行操作,所以可能还有其他原因。给我们看看完整的分机拉链。
//manifest.json file
{
    "manifest_version": 2,
    "name": "Focus",
    "version": "1.0",
    "description":"This app has a unique functionality that keeps you stayin` focused",
    "content_scripts": [
        {
          "css": [ "index.css" ],
          "matches": ["https://www.youtube.com/*"],
          "js": ["jquery.min.js","./main.js"]
        }
      ],
    "icons": { 
               "48": "icon48.png"},
    "browser_action": {
               "default_icon": "icon48.png",
              "default_popup": "popup.html",
              "default_title": "Focus!"
            }
  }