<body onhashchange="myFn()">
<a href="#123">123</a>
<a href="#456">456</a>
</body>
<script>
function myFn() {
console.log('good1230.com')
}
</script>
let textarea = document.querySelector('textarea')
textarea.onbeforeinput = function (e) {
let RegEx = /[0-9]/
if (RegEx.test(e.data)) {
e.returnValue = false
}
}
[root@localhost ~]# groupadd [选项] 组名
[root@localhost ~]# groupmod [选现] 组名
[root@localhost ~]# groupdel 组名
查看用户hlj的uid和gid
[hlj@localhost html]$ id hlj
uid=1002(hlj) gid=1004(hlj) 组=1004(hlj)
把hlj用户加入root组后,查看用户hlj的uid和gid
[root@localhost /]# usermod -G root hlj
[hlj@localhost html]$ id hlj
uid=1002(hlj) gid=1004(hlj) 组=1004(hlj),0(root)
const dgram = require("dgram");
const client = dgram.createSocket('udp4');
client.send('客户端发起的信息!', 41234, 'localhost', (err) => {
client.close();
});
const http = require('http');
const fs = require('fs');
http.createServer(function (req, res) {
(async () => {
const file = fs.readFileSync('log.txt');
console.log(file.toString())
})();
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('Node.js says hello!');
res.end();
}).listen(8080);
import { test, expect } from '@playwright/test';
test('test', async ({ page, context }) => {
//在创建/导航页面之前开始跟踪
const obj = {
screenshots: true,
snapshots: true,
sources: true
}
await context.tracing.start(obj)
await page.goto('http://good1230.com/');
//遍历菜单
const count = await page.locator('ul.width-135 > a.none-line').count();
const rows = await page.locator('ul.width-135 > a.none-line');
for (let i = 0; i < count; ++i) {
await rows.nth(i).click()
await expect(page).toHaveURL(page.url());
console.log(page.url())
}
// 停止跟踪并将其导出到 zip 存档中。
await context.tracing.stop({ path: "trace.zip" })
});