• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4251 shaares
1 / 7
Filters
133 results tagged javascript

An HTML element id is a global variable

QRCode

Little relatively unknown fact, if you have an id attribute on an element, you can reference it in this way:

<button id="yo">…</button>
yo.onclick = ...

Furthermore, child elements with a name attribute can be referenced in this way:

<form id="x"> 
  <input name="em"> 
</form>
x.em.onclick = ...
https://flaviocopes.com/an-html-element-id-is-a-global-variable/
October 7, 2024 at 3:36:27 PM EDT *
javascript webdesign forms css
FILLER

Paul Buchheit, Gmail’s Architect: The Full Transcript

QRCode

paul buchheit on the advent of gmail, insurgents vs. gatekeepers, the future of san francisco, ai,

An insurgent is never going to be successful working for gatekeepers, because from the gatekeeper perspective, the person just lacks maturity. They're doing these things that are obviously risky. That's the nature of throwing bombs: you don't exactly know what's going to happen.

Famously, we had one line of JavaScript in the entire product, which was when you go to the homepage, there was one snippet of JavaScript that would put the focus in the search box. That was the only JavaScript at Google. So Google had this kind of anti-JavaScript thing, that was also partially technical snobbery. One of the senior technical people said, “You can never scale anything in JavaScript, it’s basically just shit, the project will just turn to garbage.” And actually Eric Schmidt even said, “Oh yeah, my friend at some other big company tried this, it doesn't work.” There was a lot of ‘This has been done before, you just don't know why it can't work.’

Gatekeepers are one hundred percent anchored to stopping bad things from happening, and they have no concept that when you stop bad things from happening, you are inherently stopping good things from happening as well. You can't ever deliver something that's 100 percent good. If you deliver 80 percent good, that's pretty good. But if you try to go for 100% — if you try to be perfect — what you get is nothing. Innovation is inherently not clean.

https://www.piratewires.com/p/paul-buchheit-interview-transcript-mike-solana
June 19, 2024 at 9:55:00 AM EDT *
javascript career google
FILLER

javascript - How to inspect JQuery UI tooltip? - Stack Overflow

QRCode

I have a default JQuery UI tooltip function call on my page. Is there a way to style the tooltip div interactively using the Inspector? If I had two mouse pointers, one would be hovering over an el...

2- Choose Sources: Choose Sources

3- On the right side, you found accordion, Open "Event Listener Breakpoints" Open "Event Listener Breakpoints"

4- You will found all events, Open "Mouse", then Select "mouseout" event, this will stop execution of code and stop before "mouseout action". Open "Mouse", then Select "mouseout"

5- Go to App screen, and Try to hover only the item which has the tooltip, then screen will freeze, and you will found the tooltip stand as you want. tooltip stand as you want

https://stackoverflow.com/questions/18815749/how-to-inspect-jquery-ui-tooltip
March 27, 2024 at 10:05:57 AM EDT *
chrome javascript jquery tooltip
FILLER

Bookmarklet Maker

QRCode

Bookmarklet creator tool.

https://caiorss.github.io/bookmarklet-maker/
March 18, 2024 at 1:37:41 PM EDT *
bookmarklet javascript webdesign browser
FILLER

How Marketing Changed OOP In JavaScript — Smashing Magazine

QRCode

Discussing the decisions surrounding JavaScript prototypes, the article by Juan Diego Rodriguez scrutinizes their origin, examines missteps in the design, and explores how these factors have affected the way we write JavaScript today.

There is no difference, and JavaScript will execute the same code, but the latter example is honest about what JavaScript is doing under the hood, while the former hides it behind syntactic sugar.

Do I have a problem with the classical approach? Yes and no. An argument can be made that the classical syntax improves readability by having all the code related to the class inside a block scope. On the other hand, it’s misleading and has led thousands of developers to believe that JavaScript has true classes when a class in JavaScript is no different from any other function object.

https://www.smashingmagazine.com/2023/12/marketing-changed-oop-javascript/
January 13, 2024 at 11:03:02 AM EST *
javascript programming oop
FILLER

14 Linting Rules To Help You Write Asynchronous Code in JavaScript - Maxim Orlov

QRCode

A compiled list of linting rules to specifically help you with writing asynchronous code in JavaScript and Node.js.

https://maximorlov.com/linting-rules-for-asynchronous-code-in-javascript/
November 20, 2023 at 8:11:08 PM EST *
javascript nodejs eslint
FILLER

What Removing Object Properties Tells Us About JavaScript — Smashing Magazine

QRCode

Removing properties from an object in JavaScript might not be the most exciting job, but there are many ways to achieve it, each revealing a fundamental aspect of how JavaScript works. Juan Diego Rodríguez explores each technique in this article.

  • Contestant A: “I set c to undefined.”
  • Contestant B: “I used the delete operator.”
  • Contestant C: “I deleted the property through a Proxy object.”
  • Contestant D: “I avoided mutation by using object destructuring.”
  • Contestant E: “I used JSON.stringify and JSON.parse.”
  • Contestant F: “We rely on Lodash at my company.”
https://www.smashingmagazine.com/2023/10/removing-object-properties-javascript/
November 2, 2023 at 11:55:27 AM EDT *
javascript programming
FILLER

Dangers of Regular Expressions in JavaScript | Sonar

QRCode

A deep investigation into regular expression denial of service (ReDoS) vulnerabilities in JavaScript

Backtracking
It might not seem obvious, but most problems with regular expressions stem from failing to match part of the string they are being evaluated against. Matching is easy, but not matching can cause a process called backtracking where the regular expression engine will go back over choices that it made and try alternatives.

Lost in spaces
Let's have a look at an example. In the Stack Overflow outage, the offending regular expression was /^[\s\u200c]+|[\s\u200c]+$/. Let's break down what each part means:

https://www.sonarsource.com/blog/vulnerable-regular-expressions-javascript/
October 24, 2023 at 11:13:02 AM EDT *
regex javascript
FILLER

A Civilised Guide to JavaScript Array Methods

QRCode

I’ve created a cheat sheet that will tell you precisely when to use each JS array method. It’s a free gift for anyone who subscribes to my email updates.

https://jrsinclair.com/javascript-array-methods-cheat-sheet
March 2, 2023 at 8:58:58 AM EST *
javascript
FILLER

How to store your app's entire state in the url

QRCode

I decided to encode the entire application state as a Base64 encoded string in the hashmark of the url. For example, a url would look like (note its truncated since they are very long):

Here's the pseudo code for creating the url, and then later reading it:

const stateString = JSON.stringify(appState); // appState is a json object
const compressed = compress(stateString);
const encoded = Base64.encode(compressed);
// Push that `encoded` string to the url
// ... Later, on page load or on undo/redo we read the url and
// do the following
const decoded = Base64.decode(encoded); // same encoded as above, but read from url
const uncompressed = uncompress(decoded);
const newState = JSON.parse(uncompressed);
// Now load your application with the newState

A better idea is to use the URI fragment (the string after the # sign). It has the advantage of not having a size limit, and not needing to be sent all to the backend during the request. window.location.hash is your friend.

https://www.scottantipa.com/store-app-state-in-urls
March 1, 2023 at 11:01:31 AM EST *
javascript json
FILLER

Private Members in JavaScript

QRCode

Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Here's how.

http://www.crockford.com/javascript/private.html
September 12, 2022 at 4:55:02 PM EDT *
javascript
FILLER

Understand ES6 in 20 Minutes

QRCode
https://javascript.plainenglish.io/understand-es6-in-20-minutes-8ab8f958e379
September 6, 2022 at 4:05:53 PM EDT *
javascript programming
FILLER

How Use ESLint to Write Elegant Code in JavaScript and TypeScript

QRCode
https://betterprogramming.pub/use-eslint-to-make-your-javascript-typesript-code-more-professional-1170bbdff32b
August 17, 2022 at 8:29:03 AM EDT *
javascript eslint
FILLER

Explore DOM Events 👩‍🔬

QRCode

A visualizer to help you learn how the DOM Event system works through exploration. Explore event phases, stopping events, canceling events, passive events and more.

https://domevents.dev/
May 11, 2022 at 6:55:00 AM EDT *
javascript jquery webdesign
FILLER

Node.js :: Eloquent JavaScript

QRCode

One of the more difficult problems with writing systems that communicate over the network is managing input and output—that is, the reading and writing of data to and from the network and hard drive. Moving data around takes time, and scheduling it cleverly can make a big difference in how quickly a system responds to the user or to network requests.

In such programs, asynchronous programming is often helpful. It allows the program to send and receive data from and to multiple devices at the same time without complicated thread management and synchronization.

https://eloquentjavascript.net/20_node.html
February 24, 2022 at 1:42:36 PM EST *
nodejs javascript tutorial
FILLER

Minify - JavaScript and CSS minifier

QRCode

Minify JS and CSS online, or include the minifier in your project for on-the-fly compression.

https://medium.com/ux-seo-sem-and-webdev-bitesized/top-7-css-minifiers-comparison-f90e28ea0e20

https://www.minifier.org
January 25, 2022 at 10:43:33 AM EST *
minify css javascript
FILLER

Getting Started With jQuery - Ajax The Basics

QRCode

Wanting to make use of Ajax is one of the prime reasons for adopting jQuery.

$.get("mydata.txt").then(
                    function (data) {
                     alert(data);
                    },
                    function () {
                     alert("error");
                    })
                   .always(
                    function () {
                     alert("cleanup");
                    });
https://www.i-programmer.info/programming/jquery/8895-getting-started-with-jquery-ajax-the-basics.html
November 17, 2021 at 11:58:35 AM EST *
jquery javascript ajax promises
FILLER

50 JavaScript Interview Questions You Must Prepare in 2021

QRCode

JavaScript interview questions that will provide you with in-depth knowledge and help you prepare for your interviews.

https://javascript.plainenglish.io/50-javascript-interview-questions-you-must-prepare-in-2021-92fbfb370ed3
September 20, 2021 at 8:21:45 AM EDT *
javascript interviewing
FILLER

Crockford Objects in JavaScript

QRCode

The example that Crockford gave in his presentation on how to create objects is the way developers should use for creating objects. It does not require the 'class' keyword or the 'prototype' property for defining an object. It also does not require using the 'new' keyword for instantiating a new object.

function createThing(name) {
    function getName() {
        return name;
    }

    return Object.freeze({
        name,
        getName
    });
}

const myThing = createThing('My Thing');

https://youtu.be/XFTOG895C7c?t=2807

https://fek.io/blog/crockford-objects-in-java-script
September 16, 2021 at 11:06:32 AM EDT *
javascript programming
FILLER

Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Jun, 2021 | Medium

QRCode

Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript. This one-liner uses the Boolean constructor to magically remove all falsy values from an array ✨.

https://twitter.com/kentcdodds/status/1009918457394225152

const plugins = [
    isProd ? optimizePlug : null,
    isProd ? prodOnlyPlug : null,
    !isProd ? testingPlug : null,
    usefulPlug,
].filter( Boolean );
https://medium.com/coding-at-dawn/kent-c-dodds-filter-trick-will-change-how-you-use-javascript-87b5112f9f6d
July 9, 2021 at 9:31:51 AM EDT *
javascript coding perl
FILLER
1 / 7
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community