我正在尝试在我的网站上设置搜索功能,我正在尝试查找IndexedDB代码
SELECT "column" FROM "table" WHERE "column" LIKE "%keyword%"
我在IndexedDB模糊搜索中找到了一个解决方案
db.transaction(['table'], 'readonly')
.objectStore('table')
.openCursor(IDBKeyRange.bound(keyword, keyword + '\uffff'), 'prev')
.onsuccess = function (e) {
e || (e = event);
var cursor = e.target.result;
if (cursor) {
console.log(cursor.value.column);
cursor.continue();
}
};
Run Code Online (Sandbox Code Playgroud)
但我怎样才能找到"%keyword%"而不是"%keyword"?
我想<script>在html中获取标记的内容:
我可以<script>test</script>使用jquery 获取内容$("script").html().
但如何获得内容
<script src='something.js'></script>
?
我想使用jquery获取文件的内容,通常我可以使用:
$.get("file", function(data) { alert(data) }
当我尝试获取javascript文件时,jquery在返回回调之前运行javascript代码.
如何在不运行代码的情况下获取文件内容?
我需要在用户空间中交换私有数据。
\n因为gun.grantandgun.trust已被弃用,所以我遵循了这个例子:
https://gun.eco/docs/SEA#quickstart \n
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>\n<script src="https://cdn.jsdelivr.net/npm/gun/sea.js"></script>\n<script>\n// var Gun = require(\'gun\'); // in NodeJS \n// require(\'gun/sea\');\nvar SEA = Gun.SEA;\n;(async () => {\nvar pair = await SEA.pair();\nvar enc = await SEA.encrypt(\'hello self\', pair);\nvar data = await SEA.sign(enc, pair);\nconsole.log(data);\nvar msg = await SEA.verify(data, pair.pub);\nvar dec = await SEA.decrypt(msg, pair);\nvar proof = await SEA.work(dec, pair);\nvar check = await SEA.work(\'hello self\', pair);\nconsole.log(dec);\nconsole.log(proof === check);\n// now let\'s share private data with someone:\nvar alice = await SEA.pair();\nvar bob …Run Code Online (Sandbox Code Playgroud)