39
2023-06-17 10:19:32 39阅读 0喜欢
<body onhashchange="myFn()">
    <a href="#123">123</a>
    <a href="#456">456</a>
</body>
<script>
    function myFn() {
        console.log('good1230.com')
    }
</script>
796访问人次
Camila Waz 2022-01-22 18:22:10
31
2023-06-17 09:53:41 31阅读 0喜欢
let textarea = document.querySelector('textarea')
    textarea.onbeforeinput = function (e) {
        let RegEx = /[0-9]/
        if (RegEx.test(e.data)) {
            e.returnValue = false
        }
    }
2022-11-21 21:45:44 254阅读 0喜欢
26
2022-11-20 18:42:03 26阅读 0喜欢
[root@localhost ~]# groupadd [选项] 组名
[root@localhost ~]# groupmod [选现] 组名
[root@localhost ~]# groupdel 组名
20
2022-11-20 18:23:03 20阅读 0喜欢

查看用户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)
2022-11-20 18:00:38 34阅读 0喜欢
2022-11-19 10:01:16 101阅读 0喜欢
75
2022-11-15 20:16:44 75阅读 0喜欢
const dgram = require("dgram");
const client = dgram.createSocket('udp4');

client.send('客户端发起的信息!', 41234, 'localhost', (err) => {
    client.close();
});

https://nodejs.org/api/dgram.html#event-close

2022-11-13 21:14:01 79阅读 0喜欢
61
2022-11-10 21:34:35 61阅读 0喜欢
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);
81
2022-11-06 13:48:22 81阅读 0喜欢
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" })
});