recentpopularlog in

kme : javascript   1050

« earlier  
html - Howto: div with onclick inside another div with onclick javascript - Stack Overflow
Basically there are two event models in javascript. Event capturing and Event bubbling. In event bubbling, if you click on inside div, the inside div click event fired first and then the outer div click fired. while in event capturing, first the outer div event fired and than the inner div event fired. To stop event propagation, use this code in your click method.

<code class="language-javascript">if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();</code>
webdevel  javascript  eventhandling  capture  bubbling  explained 
10 days ago by kme
SyntaxError: missing : after property id - JavaScript | MDN
ES6 only, FYI.
If you create a property key from an expression, you need to use square brackets. Otherwise the property name can't be computed:
<code class="language-javascript">var obj = { 'b'+'ar': 'foo' };
// SyntaxError: missing : after property id</code>

Put the expression in brackets []:
<code class="language-javascript">var obj = { ['b'+'ar']: 'foo' };</code>
javascript  objects  keys  syntax  errormessage  solution  webdevel  til  es6 
17 days ago by kme
javascript - window.onload vs document.onload - Stack Overflow
Vanilla version currently in style seems to be something like:
<code class="language-javascript">window.addEventListener('load', function() {
console.log('All assets are loaded')
})</code>
webdevel  javascript  jquery  onload  dammitbrain 
4 weeks ago by kme
javascript - Remove All Event Listeners of Specific Type - Stack Overflow
I ended up binding to 'window.onscroll' and just set 'document.documentElement.scrollTop = 0' each time it fired, which is janky when there are a ton of scroll events queued.

But nothing else--neither 'e.preventDefault()' nor 'e.stopPropagation()'--seemd to work.
webdevel  javascript  eventhandler  mousewheel  scrolling  sortof  workaround  solution 
10 weeks ago by kme
Creating a package.json file | npm Documentation
<code class="language-json">{
"name": "my-awesome-package",
"version": "1.0.0"
}</code>

or:
<code class="language-bash">npm init</code>
webdevel  javascript  npm  packaging  dammitbrain  solution 
10 weeks ago by kme
The Myth of 'It's Just Javascript'
*The phrase is often used in its unfinished state and so its meaning is often misconstrued. In full, the phrase reads “A jack of all trades is a master of none but oftentimes better than a master at one.”

Contrary to the commonly-held negative notion of being a generalist (i.e. jack of all trades), the true nature of the phrase reveals that being a generalist is actually not a bad thing at all.
javascript  frontend  webdevel  woes 
october 2019 by kme
What is the !! (not not) operator in JavaScript? - Stack Overflow
An easy way to describe it is: Boolean(5) === !!5; Same casting, fewer characters
devel  javascript  boolean  idiom  syntax  newbie  dammitbrain 
september 2019 by kme
Re: We plan to transition from RT to GitHub - nntp.perl.org
It's interesting to hear people call out their beefs with GitHub, like:
I actually do want credit for my work; but I'm not going to have my (limited) web presence tied to a flashy, for-profit site.
github  opensource  culture  freedom  javascript 
august 2019 by kme
Chrome DevTools  |  Tools for Web Developers  |  Google Developers
When you want to work with the DOM or CSS, right-click an element on the page and select Inspect to jump into the Elements panel. Or press Command+Option+C (Mac) or Control+Shift+C (Windows, Linux, Chrome OS).
webdevel  chrome  chromium  browser  devtools  debugging  javascript  console 
august 2019 by kme
Firefox Developer Tools | MDN
You can open the Firefox Developer Tools from the menu by selecting Tools > Web Developer > Toggle Tools or use the keyboard shortcut Ctrl + Shift + I or F12 on Windows and Linux, or Cmd + Opt + I on macOS.
webdevel  firefox  browser  devtools  debugging  javascript  console 
august 2019 by kme
Sorting strings properly is stupidly hard – Daniel Lemire's blog
However, I tried to test out the sorting on fr_ca locale and got the incorrect answer, which I found out was due to incorrect locale settings on Max OS X/BSD. On my machine, fr_FR.UTF-8 collation is linked to la_LN.US-ASCII
sorting  ishard  collation  strings  devel  javascript  python  pitfalls  macos  elcapitan  brokenness 
july 2019 by kme
GitHub - sstephenson/eco: Embedded CoffeeScript templates
Apparently Basecamp used this along with Backbone.js for their calendar view.
coffeescript  javascript  template  library 
july 2019 by kme
AutoTOC
This script was not written by me, all credits go to the original author: Rune Skaug (see: UserScripts-Mirror).

I use this script for years, and though it was last updated in 2006, it still does a great job: it adds a TOC (table-of-contents) to each page, making long pages much easier to navigate. For the TOC not eating screen space unnecessarily, I recommend using it together with my Hide/unHide AutoTOC navigation bar user style.
toc  tableofcontents  userscript  javascript  bookmarklet 
july 2019 by kme
Table of Contents Everywhere
This one is good.
On pages which do not have a Table of Contents, but should do, create one! (I actually use this as a bookmarklet, so I can load it onto the current page only when I want it.)
userscript  javascript  bookmarklet  toc  tableofcontents  solution 
july 2019 by kme
GitHub Table of Contents
I think this was ripped from a Chrome extension. Did not try it, since https://greasyfork.org/en/scripts/7673-table-of-contents-everywhere worked fine for what I needed.
bookmarklet  userscript  toc  tableofcontents  github  javascript 
july 2019 by kme
GitHub - snabbdom/snabbdom: A virtual DOM library with focus on simplicity, modularity, powerful features and performance.
A virtual DOM library with focus on simplicity, modularity, powerful features and performance. - snabbdom/snabbdom
virtualdom  javascript  frontend  library 
june 2019 by kme
GitHub - nemanjan00/uniread: Uniread is Spritz like CLI fast reading software.
Uniread is Spritz like CLI fast reading software. - nemanjan00/uniread
ebook  speadreading  reader  app  npm  javascript  cli  commandline 
june 2019 by kme
GitHub - h2non/nar: node.js application archive - create self-contained binary like executable applications that are ready to ship and run
node.js application archive - create self-contained binary like executable applications that are ready to ship and run - h2non/nar
shroudedscript  shrouding  javascript  nodejs  commandline  packaging 
june 2019 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read