-
Interview for upcoming book
Here’s a transcript of my interview with Lance Redgrave for his upcoming book, Cunningly Clever Business Online. Engineering for the web – why is it important? What are the most important factors that should be considered when engineering a website/platform? First you need to determine the balance between features and budget. Maintainability, extensibility, performance, and…
-
Disallow File Uploads over 2Mb (or any size)
A quick and easy jQuery snippet to find all file upload inputs & make sure users don’t upload files that are too large. Just include in your $(function(){ }); function $(‘input[type=file]’).each(function(){ $(this).on(‘change’, function() { //this.files[0].size gets the size of your file. if (this.files[0].size > 2097152 || this.files[0].filesize > 2097152) { alert(‘Your file is too large…
-
WordPress Import Posts – Assign to Existing Author
When importing posts, pages, or custom posts from an existing WordPress installation, it asks you whether you want to import a user, assign to a new user, or assign to an existing user. If you have already imported users, you want to assign all posts to existing users. However, if you have a lot of…
-
Hijack form action & interact with page using jQuery
To create a widget that takes a user’s input of Postcode, compares it against an array of postcodes, and acts on the page telling the user whether their postcode is valid or not, you can start with the following code: <div id="MyForm"> <form method="POST" name="info-form"> <input type="hidden" value="/form-sent" name="returnURL" /> <label for="First Name">First Name: </label>…
-
Convert Table to Divs with jQuery
Dynamically converting a table, table row (tr), or table cell (td) to be div-based may seem difficult, but it’s surprisingly simple, if you have a div in each cell containing all its content. Rather than replacing the table, tr or td tags with div, you can use jQuery to create an element after the table,…