I recently had need to submit a web form with file fields via AJAX. The application uses jQuery and was already submitting forms just fine without file fields using the .serialize()
method to pass data to a jQuery.ajax()
call. That didn’t seem to handle the file fields, though. Searching the internet, I found a solution using the browser built in FormData
object.
WWW posts page 6
Firefox: Weird rendering with high contrast mode
I figured out why Firefox 91+ seemed to break some CSS rendering for me (as I blogged about a few weeks back): high contrast mode. I’ve used the accessibility setting “Increase Contrast” on Mac OS for some time to make it easier to see some interface elements. Apparently, via Firefox 91 release notes, “Firefox now automatically enables High Contrast Mode when ‘Increase Contrast’ is checked on MacOS”.
Continue reading post "Firefox: Weird rendering with high contrast mode"Atom (text editor) lost a bunch of unsaved work I had in it.
Continue reading post "#3471"Purchase: New laptop, MacBook Air
I’ve made another new laptop purchase in the past couple months: I bought a refurbished 2020 MacBook Air from Apple.com. It has a 10th gen i3 Intel processor, 8GB of RAM, and 256GB of storage. I bought it to replace my struggling 11 year old MacBook. I bought a Lenovo Yoga 7i, but was struggling to get comfortable with it for my web development work. I made the call to get the Mac so I could directly migrate both my work computer user and my personal computer users, with the plan to use it for development and use the Yoga for other stuff.
Continue reading post "Purchase: New laptop, MacBook Air"The recent Firefox Developer Edition update (91.0b6) seems to have broken CSS rendering or something.
Continue reading post "#3459"Purchase: New laptop, Lenovo Yoga 7i
Last month, I finally bought a new laptop with plans to replace my aging 2009 Macbook as my primary computer. It is a Lenovo Yoga 7i, purchased from MicroCenter. It is a switch from Mac, which has been my primary OS for pretty much since I’ve been using computers, but it has touch screen and I hope to switch to the open world of Linux.
Continue reading post "Purchase: New laptop, Lenovo Yoga 7i"Sorting with `FIELD()` function in Doctrine
I recently needed to sort query results to match the order of IDs passed to it for use in a WHERE β¦ IN()
clause. In MySQL, this can be done using the FIELD()
function in the ORDERY BY
clause. For Doctrine, which doesn’t have the FIELD()
function and doesn’t allow functions in the ORDER BY
clause, there’s a little more work needed to make use of it.
I signed up for the Ohio Vax-A-Million vaccine lottery at ohiovaxamillion.com, even though the site and domain registration seemed a little suspicious.
Continue reading post "#3417"Stir Trek 2021
I watched the Stir Trek conference today, live streaming. It was done virtually this year due to the Covid situation.
Continue reading post "Stir Trek 2021"I found myself needing to get the path to the current script and its directory in a local Node JS script recently. In Common JS scripts, that is available by __filename
or __dirname
globals, but it isn’t available by the same means in ES modules. Instead, there is import.meta.url
, which can be used to get at the directory name if needed, like:
const __filename = import.meta.url.replace(/^file:[\/]+/, '/');
const __dirname = __filename.split('/').slice(0, -1).join('/');