Simon Willison’s Weblog

Subscribe

Entries tagged javascript

Filters: Type: entry × javascript × Sorted by date


Interesting ideas in Observable Framework

Mike Bostock, Announcing: Observable Framework:

[... 2123 words]

download-esm: a tool for downloading ECMAScript modules

I’ve built a new CLI tool, download-esm, which takes the name of an npm package and will attempt to download the ECMAScript module version of that package, plus all of its dependencies, directly from the jsDelivr CDN—and then rewrite all of the import statements to point to those local copies.

[... 1240 words]

Datasette Lite: a server-side Python web application running in a browser

Datasette Lite is a new way to run Datasette: entirely in a browser, taking advantage of the incredible Pyodide project which provides Python compiled to WebAssembly plus a whole suite of useful extras.

[... 4800 words]

datasette-search-all: a new plugin for searching multiple Datasette tables at once

I just released a new plugin for Datasette, and it’s pretty fun. datasette-search-all is a plugin written mostly in JavaScript that executes the same search query against every searchable table in every database connected to your Datasette instance.

[... 819 words]

Fast Autocomplete Search for Your Website

Every website deserves a great search engine—but building a search engine can be a lot of work, and hosting it can quickly get expensive.

[... 4159 words]

Are traditional web frameworks and languages like RubyOnRail, Spring Boot and PHP dying now when new fast reactive pure JavaScript frameworks and services like Meteor, Node, Angular 2.0 and Firebase are breaking ground?

No.

[... 40 words]

How does one decide which Javascript framework (e.g. Node, Backbone, Angular) to use on any given project?

If you are just learning JavaScript, I suggest trying to work without any frameworks or libraries at all. Starting with something like Angular will make it much harder for you to learn the core language and browser APIs.

[... 137 words]

In simple terms, what is node.js?

It’s server-side programming, like PHP. The language you write the server-side code in is JavaScript (specifically the JavaScript version supported by Google’s V8 JavaScript engine, which was originally written for the Chrome web browser).

[... 46 words]

What is the most succinct definition of a JavaScript callback, being more elaborative than simply “A function that calls another function.”?

A way of saying “once you’ve finished doing this, do that”.

[... 38 words]

What are the conference/meet-ups on JavaScript that accept guest speakers?

We have a crowdsourced list of JavaScript events that are accepting speaker submissions here: JavaScript conference calls for participation

[... 53 words]

Should a beginner to web development start out with Node.Js?

Maybe. One of the things I like about Node.js is that the raw abstraction it provides over HTTP is much closer to how the actual protocol works than the abstractions provided many of the more widely used frameworks such as PHP, Django or Rails. That might actually make it an effective learning tool—I’d be interested in hearing from some web developers who learnt Node.js as their first server-side technology.

[... 87 words]

How can you run image processing in cloud code (Parse) ? If parse is not the best

There are dozens of web-based image resizing APIs that could help with this. Check out http://www.imgix.com/ for example.

[... 42 words]

Is there any alternative to devbootcamp.com or hackreactor.com in Europe?

http://www.makersacademy.com/ are running a similar program in the Old Street area of London.

[... 30 words]

Beginner JavaScript: more code or quality code?

Write more code. The more code you have written, the better you’ll be able to understand why certain techniques for creating higher quality code are worthwhile later on.

[... 70 words]

How do I choose between asynchronous web frameworks? My tech group is fairly language agnostic and we’re trying to standardize on some technologies.

Since they are all pretty close to each other and it sounds like your tech group’s skills would support any of them, I would suggest having your tram build a simple prototype in all three so you can compare them for your own particular team and situation.

[... 76 words]

What are some JavaScript concepts that took you the longest to understand?

Closures, prototype inheritance, and the “this” keyword.

[... 60 words]

What are the design mistakes in the Meteor framework?

Treating the non-JavaScript case as unimportant.

[... 21 words]

How does a web page interact with a server to parse a dynamic JSON file?

If you’re only dealing with 60 records there’s no need to add a full database. I’ve actually hand coded a 50 record JSON file before and it was fine- use an editor with good JSON support (I like Sublime Text 2) and it’s pretty easy to hand write.

[... 103 words]

How do I get started with node.js?

You don’t run Node.js in a script tag on your website. Node is a technology for writing servers in JavaScript—you can think of it as a replacement/alternative for PHP, Python, Ruby, ASP.NET etc.

[... 58 words]

What are the strategies for a front end developer to keep up to date with the emerging technologies?

Step one: find developers who you respect and subscribe to their blogs, follow them on Twitter/Google+/etc and try to understand what they are talking about and what they think is exciting.

[... 139 words]

Why is node.js so much faster?

There are two main reasons.

[... 116 words]

If I study HTML5, can I avoid having to learn javascript?

Many of the most exciting new features that fall under the term HTML5 only make sense in the context of JavaScript—things like Canvas, Web Workers, AppCache and so on. So no, you can’t learn HTML5 properly without getting familiar with JacaScript.

[... 60 words]

Can you mark items on a website as ’unread’ without cookies?

It’s not very exciting, but CSS will let you set different styles for visited vs unvisited links and the technique has worked reliably since the mid 1990s.

[... 44 words]

How difficult is to to learn a language framework, like node.js?

The answer varies enormously depending on the language and the framework. Some frameworks are very easy to pick up, others are harder.

[... 162 words]

What is a good cat name that relates to JavaScript?

I have two friends with cats that have names related to JavaScript. One is called “JavaScript” and the other is called “Widget”.

[... 38 words]

Wouldn’t an ASCII cellular automaton in javascript be the simplest starting point to teach/learn programming?

Absolutely not. The first step in learning to program is understanding that a computer can be quickly made to do something useful by executing lines of code. Personally I’m a big fan of firing up something with an interactive prompt (like Python, or even Firebug or the Google Chrome JS console) and demonstrating that typing a line of code hitting return will get a useful response.

[... 87 words]

How do you change page content and URL without reloading the whole page?

This can only be done using JavaScript. You use XMLHttpRequest to pull in new information from the server (also known as Ajax—most people use a JavaScript library such as jQuery to handle this) and then use the HTML5 history API, in particular the pushState method, to update the URL.

[... 133 words]

How can I parse unquoted JSON with JavaScript?

Unquoted JSON isn’t JSON—the JSON spec requires that strings are quoted (with double quotes, not single quotes).

[... 104 words]

Was CoffeeScript invented to help Ruby programmers get over that dirty yucky feeling they get when working in JavaScript?

The original Prototype JS library might fit that description—more than CoffeeScript, at any rate.

[... 41 words]

How long until Ruby developers are as cheap as PHP developers? is it already happening? should I still learn it or it only has a couple years left and I’m better off with SSJS?

If you want to be a highly paid engineer, you should worry less about your expertise in a specific language and more about developing broad and deep skills across a wider range of development topics.

[... 197 words]