JavaScript

2451 readers
1 users here now

founded 2 years ago
MODERATORS
26
27
28
29
30
31
32
33
 
 

I don't know if anyone here uses [Tamper|Grease]monkey, but I asked my LLM to come up with a redirect from Xitter and it gave me this gem:

// ==UserScript==
// @name         Redirect x.com to xcancel.com
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://x.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var url = window.location.href;
    url = url.replace("https://x.com/", "https://xcancel.com/");
    window.location.replace(url);
})();

Works like a charm.

34
35
36
37
38
39
 
 

The title says it all. Let's talk about one of JavaScript's most underrated features: Object.freeze(). This powerhouse of immutability isn't just another method - it's your secret weapon for writing safer, more predictable code ✨.

I'll be honest, when I first discovered Object.freeze(), I mostly ignored it. "Just don't mutate your objects," I thought. But as my applications grew more complex, I started to see its true value. Now, it's an essential part of my toolkit.

40
 
 

hello. I recently asked here for help with Lemmy HTTP API and someone said "why don't you use lemmy-js-client?". i tried to add it and...

first i searched the internet about this library and it turns out that it is an npm library... (I have github pages) i searched different variations of the library and found a cdn version of it. i tried to add it. it was a hell of a torture.... i added it the way I add cdn libraries, nothing. i searched all over the internet, but found null. i even asked chatgpt! to no avail. the library (and everything I tried to get out of it) turned into undefined!

what am I supposed to do? this is cdn version what i tried to add
if u want here is source code

41
 
 

hello! im developing lemmy client (on html5). i tried to do login function but... when i try to fetch /v3/user backend with auth-token it give me error:

{
  "error": "no_id_given"
}

but why? what im doing wrong? if you want here is my source file on github ( function: getLoggined() )

42
 
 

hello! im developing lemmy client (on html5). i tried to do login function but... when i try to fetch /v3/user backend with auth-token it give me error:

{
  "error": "no_id_given"
}

but why? what im doing wrong? if you want here is my source file on github ( function: getLoggined() )

43
44
45
46
47
1
submitted 7 months ago* (last edited 7 months ago) by xoron@programming.dev to c/javascript@programming.dev
 
 

i wanted to see if we can create asynchronous bottom-up state management, we have the basics to put together a state management system. State management solutions in apps typically have ways to persist data.

I wanted to explore if there are any benefits to define and manage state in webcomponents with a bottom-up approach. I wanted to see if it could give a greater flexibility in developing a UI and not having to worry about persisted storage management.

https://positive-intentions.com/blog/bottom-up-storage

48
49
50
 
 

On November 22, 2024, Deno formally filed a petition with the USPTO to cancel Oracle’s trademark for “JavaScript.” This marks a pivotal step toward freeing “JavaScript” from legal entanglements and recognizing it as a shared public good.

Oracle has until January 4, 2025, to respond. If they fail to act, the case will go into default, and the trademark will likely be canceled.

view more: ‹ prev next ›