简体   繁体   English

如果网页或网站已经具有jquery版本,则jQuery在chrome扩展程序中失败。 我想要Jquery Selector脚本

[英]Jquery fails in chrome extension if a page or website have already a version of jquery. I want Jquery Selector script

i want jquery selector script. 我想要jQuery选择器脚本。 but i don't want to use jquery library. 但我不想使用jQuery库。

i am building a chrome extension. 我正在建立一个Chrome扩展程序。 when i use jquery in extension so when it called in a page or website which is using already jquery then it fails. 当我在扩展名中使用jquery时,当它在已使用jquery的页面或网站中调用时,它将失败。 Don't tell me for jquery.conflict(). 不要告诉我jquery.conflict()。

i want a library or script which performs like: 我想要一个执行类似的库或脚本

$("#some").val()
$("some").val()
$(".some").val()

Atleast all possible functions, or minimum setAttributeValue() I think you got it what i want... 尽量使用所有可能的函数,或最小化setAttributeValue(),我想您已经得到了我想要的...

Just use the native .querySelector() or .querySelectorAll() methods to select the elements, then use the native .value property or getAttribute() method to retrieve what you need. 只需使用本机.querySelector().querySelectorAll()方法来选择元素,然后使用本机.value属性或getAttribute()方法来检索所需的内容。 Loading a library for this is like cracking a nut with a sledgehammer. 为此加载库就像用大锤砸开螺母一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当页面上已有旧版本时,如何在chrome扩展内容脚本中使用jquery - How can I use jquery in a chrome extension content script when an older version is already on the page Chrome扩展程序的内容脚本中的jQuery:input选择器 - jQuery :input selector in Chrome Extension's Content script 从 Chrome 扩展程序访问页面的选择器或 JQuery 实例 - Access page's selector or JQuery instance from a Chrome Extension 通过Chrome扩展程序将jQuery附加到网站 - Appending jquery to website by chrome extension 用jquery。()。each和for循环迭代失败 - Iterating with a jquery.().each and for loop fails jquery中$('selector')[0],$('selector')。eq(index)之间的区别。 - Difference between $('selector')[0] ,$('selector').eq(index) in jquery. jQuery 中的“没有类”选择器。 通过包含多个类的特定类名选择一个元素 - 'Does not have class' selector in jQuery. Select an element by particular class name which holds multiple classes 如何在 Chrome 扩展中使用 setTimeout 将 jQuery 注入页面? - How can I inject jQuery into page using setTimeout in a Chrome extension? 为Chrome优化jquery选择器 - Optimizing jquery selector for Chrome 使用插件Magnific Popup,我必须使用jquery。 但是,当我加载页面时,它会大大减慢速度 - Using the plugin Magnific Popup, I have to use jquery. However when I load the page it slows down dramatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM