[英]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.