<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>javascript on Tom Roth</title><link>https://tomroth.dev/tags/javascript/</link><description>Recent content in javascript on Tom Roth</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 16 Nov 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://tomroth.dev/tags/javascript/index.xml" rel="self" type="application/rss+xml"/><item><title>A primer on progressive enhancement</title><link>https://tomroth.dev/progressive-enhancement/</link><pubDate>Sat, 16 Nov 2019 00:00:00 +0000</pubDate><guid>https://tomroth.dev/progressive-enhancement/</guid><description>When you build a website, it should work everywhere.
Websites should work with new browsers, but also with old browsers. They should work for users using speech-navigation software, and for those with slow mobile connections. Websites should also work for agents who don’t use them visually, like a web crawler.
You&amp;rsquo;d love to show your awesome website properly to every user. Unfortunately, in real life that&amp;rsquo;s often not possible. So go for second best: provide some core functionality to everyone, and then give the enhancements to the browsers that can handle it.</description></item><item><title>Playing a sound file with React and Webpack</title><link>https://tomroth.dev/react-sound/</link><pubDate>Mon, 04 Nov 2019 00:00:00 +0000</pubDate><guid>https://tomroth.dev/react-sound/</guid><description>One Link to heading Get the sound file you want (e.g. sound.mp3) and put it somewhere in your src directory.
Two Link to heading Add this to your webpack.config.js file. Make sure you have file-loader installed (run npm install --save-dev file-loader if you don’t.)
{ test: /\.mp3$/, loader: &amp;#39;file-loader&amp;#39;, query: { name: &amp;#39;static/media/[name].[hash:8].[ext]&amp;#39; } } Three Link to heading Import the file at the top of your JavaScript file. Put the path relative to the JavaScript file you are loading the sound from.</description></item><item><title>Integrating Javascript and d3 into R notebooks</title><link>https://tomroth.dev/r-d3/</link><pubDate>Thu, 13 Apr 2017 00:00:00 +0000</pubDate><guid>https://tomroth.dev/r-d3/</guid><description>Recently the team over at RStudio released R Notebooks.
R Notebooks are really interesting. Here&amp;rsquo;s why:
You can write code in several different languages in one document (including python, bash, dot, ruby, javascript, sql) You can write in Markdown You can write in HTML You can see your code as it runs Writing reproducible code is easier It&amp;rsquo;s easy to share code results with others It&amp;rsquo;s the intertwining of languages bit that interests me the most.</description></item><item><title>What is a JavaScript method?</title><link>https://tomroth.dev/js-methods/</link><pubDate>Sat, 09 Jul 2016 00:00:00 +0000</pubDate><guid>https://tomroth.dev/js-methods/</guid><description>Javascript contains objects, which are things like a document, a window or a frame.
Objects can also be something that you define yourself. This is an object:
var cricketer = {firstName:&amp;#34;Ricky&amp;#34;, lastName:&amp;#34;Ponting&amp;#34;, age:41, batAvg: 51.85}; A method is a function that is performed on an object. Methods belong to objects.
Here&amp;rsquo;s the object from earlier, this time with a method called getSummary attached:
var cricketer = {firstName:&amp;#34;Ricky&amp;#34;, lastName:&amp;#34;Ponting&amp;#34;, age:41, batAvg: 51.</description></item></channel></rss>