gpt4 book ai didi

javascript - 使用 jQuery 按 id 隐藏 div 在 Greasemonkey 中不起作用?

转载 作者:行者123 更新时间:2023-11-30 17:11:11 26 4
gpt4 key购买 nike

this Newyorker webpage , 顶部边框(显示“纽约客”)占用了大量空间。
我在“开发者火狐版”打开网页,使用网页检查器发现边框的div id是mobile-nav-container

那么,为什么下面的代码不起作用? :

// ==UserScript==
// @name newyorker
// @namespace N
// @include http://www.newyorker.com/*
// @version 1
// @grant none
// ==/UserScript==
console.log('Grease monkey start');
$('#mobile-nav-container').hide();
console.log('Grease monkey end');

最佳答案

他们似乎在将 $ 函数用于其他用途。尝试:

jQuery('#mobile-nav-container').hide();

关于javascript - 使用 jQuery 按 id 隐藏 div 在 Greasemonkey 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26975167/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com