02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C H A P T E R 7<br />

■ ■ ■<br />

Enhancing the User Interface<br />

with <strong>jQuery</strong><br />

The application as it st<strong>and</strong>s now is fully functional. Events can be viewed, <strong>and</strong> users with administrative<br />

clearance can log in to create, edit, or delete events.<br />

The next step is to add a layer of polish to the app that creates that finished look-<strong>and</strong>-feel, which<br />

you’ll accomplish using a technique called progressive enhancement to add AJAX functionality to the<br />

app.<br />

Adding <strong>Pro</strong>gressive Enhancements with <strong>jQuery</strong><br />

<strong>Pro</strong>gressive enhancement is a term originally coined <strong>by</strong> Steven Champeon 1 in 2003 to describe a webdevelopment<br />

technique in which applications are designed to be accessible to any Internet connection<br />

<strong>and</strong> browser using semantic HTML <strong>and</strong> other technologies that are applied in layers (such as CSS files<br />

<strong>and</strong> JavaScript markup).<br />

For an application to follow the principles of progressive enhancement, it must adhere to the<br />

following guidelines:<br />

• Basic content is accessible to all browsers using the simplest, most semantic<br />

HTML markup possible.<br />

• All of the basic functionality of the app works in all browsers.<br />

• The user’s preferences are respected; this means that the web app doesn’t<br />

override browser settings (such as window size).<br />

• Externally linked CSS h<strong>and</strong>les the styling <strong>and</strong> presentation of the document.<br />

• Externally linked JavaScript enhances the user experience, but it remains<br />

unobtrusive, or non-essential to the application’s operation.<br />

Your application already meets the first four guidelines (it’s not pretty, but the application will work<br />

with styles disabled). So as long as your JavaScript doesn’t create any new functionality that can’t be<br />

accessed with JavaScript disabled, you will have successfully created a progressively enhanced web<br />

application.<br />

1<br />

http://www.hesketh.com/about-us/leadership-team/<br />

235

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!