Posts Tagged ‘JavaScript’

We are pleased to present below all posts tagged with ‘JavaScript’.

The Future Of Screen Typography Is In Your Hands

We do more reading on the screen today than we did even a year ago. If we are ever to have a golden age of reading on the screen, this might be the start of it. Tablets, Nooks and Kindles make buying a book or magazine for the screen almost unavoidable. With smartphones, we carry our reading material with us and enjoy instant Web access, enabling the reading experience to flow smoothly from one device to another.

The Future Of Screen Typography Is In Your Hands

And those devices probably have stunning HD reader-friendly screens. Throw in companion services like Readmill and 24symbols, which allow us to share our reading experiences, and we have perfect screen-based access to all aspects of the written word. So, why isn’t Web and screen typography keeping up?

Read more...

Auto-Save User’s Input In Your Forms With HTML5 And Sisyphus.js

Editor’s note: This article is the third in our new series that introduces new, useful and freely available tools and techniques, developed and released by active members of the Web design community. The first article covered PrefixFree; the second introduced Foundation, a responsive framework that helps you build prototypes and production code. This time, we’re presenting Sisyphus.js, a library developed by Alexander Kaupanin to provide Gmail-like client-side drafts and a bit more.

Have you ever been filling out a long form online or writing an eloquent and spirited comment when suddenly the browser crashes? Or perhaps you closed the browser tab accidentally, or your Internet connection cuts off, or the electricity goes down (and, being ever obedient to Murphy’s Law, you had no backup power supply). If not, then you’re lucky. But no one is protected from such minor catastrophes.

screenshot

Imagine the storm of emotions felt by a user who had to add just a bit more information before submitting a form and then loses all data. Horrible, huh? Now, if only there was a way to recover that data, rather than undertake a Sisyphean pursuit.

Read more...

How To Create Web Animations With Paper.js

The Web is just starting to use animation well. For years, animated GIFs and Flash ruled. Text moved and flashed, but it was never seamless. Animations had boxes around them like YouTube videos. HTML5 canvas changes everything about Web animation.

How To Create Web Animations With Paper.js

The canvas element makes it possible to integrate drawings and animations with the rest of your page. You can combine them with text and make animations interactive. This drawing mechanism is powerful, but very low-level. Animations get more power and need less coding when you combine the canvas tag with higher-level libraries such as Paper.js. This article introduces HTML5 animation and walks you through creating an animation of dandelion seeds blowing in the wind.

Read more...

Analyzing Network Characteristics Using JavaScript And The DOM, Part 1

As Web developers, we have an affinity for developing with JavaScript. Whatever the language used in the back end, JavaScript and the browser are the primary language-platform combination available at the user’s end. It has many uses, ranging from silly to experience-enhancing.

In this article, we’ll look at some methods of manipulating JavaScript to determine various network characteristics from within the browser — characteristics that were previously available only to applications that directly interface with the operating system. Much of this was discovered while building the Boomerang project to measure real user performance.

Read more...

Lessons From A Review Of JavaScript Code

Before we start, I’d like to pose a question: when was the last time you asked someone to review your code? Reviewing code is possibly the single best technique to improve the overall quality of your solutions, and if you’re not actively taking advantage of it, then you’re missing out on identifying bugs and hearing suggestions that could make your code better.

None of us write 100% bug-free code all of the time, so don’t feel there’s a stigma attached to seeking help. Some of the most experienced developers in our industry, from framework authors to browser developers, regularly request reviews of their code from others; asking whether something could be tweaked should in no way be considered embarrassing. Reviews are a technique like any other and should be used where possible.

Read more...

Survey: Essential JavaScript for New Projects

Like many developers I have a standard set of files that I simply copy into every new project I start. These include base HTML templates, useful PHP functions, Sass mixins and a number of JavaScript files that I can't live without. With the advent of great libraries like Modernizr and polyfills such as the indepensable html5shim we are becoming more reliant on these resources to help us create great web sites and applications.

I thought it would be interesting to learn more about the libraries and scripts our readers on Smashing Coding use on a daily basis.

Read more...

Optimizing Long Lists Of Yes / No Values With JavaScript

Very frequently in Web development (and programming in general), you need to store a long list of boolean values (yes/no, true/false, checked/unchecked… you get the idea) into something that accepts only strings. Maybe it’s because you want to store them in localStorage or in a cookie, or send them through the body of an HTTP request. I’ve needed to do this countless times.

The last time I stumbled on such a case wasn’t with my own code. It was when Christian Heilmann showed me his then new slide deck, with a cool feature where you could toggle the visibility of individual slides in and out of the presentation. On seeing it, I was impressed. Looking more closely, though, I realized that the checkbox states did not persist after the page reloaded. So, someone could spend a long time carefully tweaking their slides, only to accidentally hit F5 or crash their browser, and then — boom! — all their work would be lost. Christian told me that he was already working on storing the checkbox states in localStorage. Then, naturally, we endlessly debated the storage format. That debate inspired me to write this article, to explore the various approaches in depth.

Read more...

How To Use AJAX In WordPress

In the last few years AJAX has creeped into websites and has slowly become THE way to create dynamic, user friendly and responsive websites. AJAX is the technology that lets you update the contents of a page without actually having to reload it in a browser. For example, Google Docs utilizes this technology when saving your work every few minutes.

sm-ajax-2011

While there are a number of ways to use AJAX in Wordpress = and all are correct in the loose sense of the word - there is a method which you should be using since WordPress supports it, it is future proof, very logical, and gives you numerous options right out of the box.

Read more...

The Developer’s Guide To Conflict-Free JavaScript And CSS In WordPress

Imagine you’re playing the latest hash-tag game on Twitter when you see this friendly tweet: "You might want to check your #WP site. It includes two copies of jQuery. Nothing’s broken, but loading time will be slower."

sm-wp-css-js

You check your source code, and sure enough you see this:

<script src="/wp-includes/js/jquery/jquery.js?ver=1.6.1" type="text/javascript"></script>
<script src="http://media.mediatemple.netdna-cdn.com/wp-content/plugins/some-plugin/jquery.js"></script>

What went wrong? The first copy of jQuery is included the WordPress way, while some-plugin includes jQuery as you would on a static HTML page. A number of JavaScript frameworks are included in WordPress by default.

Read more...

A Quick Look Into The Math Of Animations With JavaScript

In school, I hated math. It was a dire, dry and boring thing with stuffy old books and very theoretical problems. Even worse, a lot of the tasks were repetitive, with a simple logical change in every iteration (dividing numbers by hand, differentials, etc.). It was exactly the reason why we invented computers. Suffice it to say, a lot of my math homework was actually done by my trusty Commodore 64 and some lines of Basic, with me just copying the results later on.

Circle

These tools and the few geometry lessons I had gave me the time and inspiration to make math interesting for myself. I did this first and foremost by creating visual effects that followed mathematical rules in demos, intros and other seemingly pointless things. There is a lot of math in the visual things we do, even if we don’t realize it. If you want to make something look natural and move naturally, you need to add a bit of physics and rounding to it.

Read more...

↑ Back to top