Jason T. Stiles

Expert Web and Mobile Applications Developer

A Primer to CSS Specificity

  • August 16th, 2011
CSS Specificity is the weight (and value) a web browser gives to a particular CSS rule.  Browsers give preference to rules which have a higher weight (the fatter the better!).  Rules that have a higher weight will overwrite rules that have a lower weight.  Let's take a look at a simple example below. A Simple Example of CSS Specificity div { background: #0000FF; /** blue */ height: 100px; width: 100px; } div.red { background: #FF0000; /** red */ } In t... Read more.

Count the Lines of Code in your Web Application with PHP

  • June 15th, 2011
Have you ever wanted to know how many lines of code your web application consists of? I have.  To find out, I created a recursive function in PHP to count the number of lines in files relating to my web application.  Since your entire web application is likely to reside under one directory (that's the assumption I use in this article), we can count the number of lines in each file, and disinclude any files that don't have the file extensions we're looking for.  For example, the sy... Read more.

How To Protect Your Site From XSS With PHP

  • June 8th, 2011
Cross-Site Scripting (XSS) is a type of attack where a hacker attempts to inject client-side scripting into a webpage that others are able to view.  The attack could be as simple as an annoying alert window or as sophisticated as stealing a logged in user's credentials (commonly saved in browser cookies).  With a user's credentials, a hacker could gain access to sensitive parts of your website or web application.  In this simple guide, I'll show you a few ways to protect your webs... Read more.

How To Submit a Form with jQuery and AJAX

  • June 1st, 2011
HTML forms make up a large part of the web. They are the primary method for retrieving input from users.  Typically, you fill out the form, click the submit button, and be redirected to a thank you page.  For web applications, this may not be ideal - you may not want the user to leave the page. In this article, I'll show you how to use jQuery's AJAX function to submit a form asynchronously to the server and avoid a redirect. A Simple Contact Form Here's an example of a simple contact... Read more.

How To Implement Keyboard Shortcuts in Your Web Application - Part 3

  • May 23rd, 2011
This is the last part of a three part series on how to implement keyboard shortcuts in a web application. In this part, we'll update our keyman object and prevent any keyboard shortcuts from activating if a user is typing into a textfield on a form. We'll also go over a couple problems you might run into when using keyboard shortcuts. If you missed the first or second part of this series, you can click either of the below links to get to them and get caught up! How to Capture Keyboard Shortcu... Read more.

Categories

Latest Posts

Chrome Developer Tools

December 10th, 2012

I just did a Lunch & Learn presentation on Chrome Developer tools last week and used the video and accompanying slides as... Read more.

Optimization is King

December 3rd, 2012

Thought I'd share this Google Docs presentation I created a while ago for a Lunch and Learn at the company I am currently wor... Read more.

New Project: OnTask

May 20th, 2012

Started development on a new Task Management Application this weekend - I have dubbed it "OnTask".  Catchy, right? My ob... Read more.