Lenix

html dialog tag element usage

In the past, in order to make a dialog effect on the page, it was often very complicated, and it was necessary to write a mask layer and write a lot of code with CSS, but I just learned that dialog is also natively supported in html. Standard usage <dialog open> <h1>Hello</h1> </dialog> It can […]

html dialog tag element usage Read More »

After upgrading PHP to 8.0, solve Fatal error: Array and string offset access syntax with curly braces is no longer supported in

After upgrading PHP to 8.0, solve Fatal error: Array and string offset access syntax with curly braces is no longer supported in PHP8.0 can no longer use curly braces to access the offset of an array or string. You need to change {} to [] to solve the problem If the code logic contains something

After upgrading PHP to 8.0, solve Fatal error: Array and string offset access syntax with curly braces is no longer supported in Read More »

After upgrading PHP to 8.0, Fatal error: Uncaught Error: Call to undefined function create_function() solution was reported.

After upgrading PHP to 8.0, Fatal error: Uncaught Error: Call to undefined function create_function() solution was reported. Because php8.0 has removed create_function. So there are 2 solutions. One. Change the create_function to an anonymous function. As shown below <?php $newfunc = create_function(‘$a,$b’, ‘return “ln($a) + ln($b) = ” . log($a * $b);’); echo $newfunc(2, M_E).

After upgrading PHP to 8.0, Fatal error: Uncaught Error: Call to undefined function create_function() solution was reported. Read More »

Session operation of JS

On the PHP server side, there are concepts of Session and Cookie, and on the JS side, there are corresponding concepts of Session and Cookie. Cookie of JS, you can use cookie.js to complete the corresponding operation. For details, see the chapter Cookie.js realizes the operation of saving user name and password (4) . Use

Session operation of JS Read More »

js detects if the page is refreshed (performs the action after each refresh)

if (performance.navigation.type == 1) { alert( “This page is reloaded” ); } … The post js to detect if the page is refreshed (perform an action after each refresh) first appeared on Lenix Blog . This article is reprinted from https://blog.p2hp.com/archives/8917 This site is for inclusion only, and the copyright belongs to the original author.

js detects if the page is refreshed (performs the action after each refresh) Read More »

ES2022 New Features at a Glance

.at() method on built-in indexables RegExp Match Indices Object.hasOwn Error cause Top-level await Class field declarations Ergonomic brand checks for private fields .at() method on built-in indexables .at method on built-in indexables ? . const cart = [ ‘?’ , … The post ES2022 New Features at a Glance first appeared on Lenix Blog .

ES2022 New Features at a Glance Read More »

Chrome debugging WebSocket

var ws = new WebSocket(‘ws://localhost:9222/devtools/page/3c5c05fa-80b7-4cfe-8d1d-ebe79a7a5730’); ws.onopen= function() { ws.send(‘{“id”: 1, “method”: “Page.navigate”, “params”: {“url”: “https://www.fangdushi.com”}}’) }; ws.onmessage = function(evt) { console.log(‘Received a message from the server!’+evt.data); }; API documentation address https://chromedevtools.github.io/devtools-protocol/1-2 … The post Chrome debugging WebSocket first appeared on Lenix Blog . This article is reprinted from https://blog.p2hp.com/archives/8911 This site is for inclusion only,

Chrome debugging WebSocket Read More »