background preloader

HTTP: The Protocol Every Web Developer Must Know – Part 1

HTTP: The Protocol Every Web Developer Must Know – Part 1

Inline scripts: sometimes the web is just screwed up : Algorithms for the masses - julian m bucknall I don’t know about you, but one of my favorite commands in the browser is “View Page Source”, especially on a site that’s modern, visually attractive, or shows off some clever interactions. After all, I’m a developer: I like to find out how things work so I can, if I want to, replicate on my own web sites. Some web pages though are really nasty when you look at their source. And one of the places they excel at nastiness is in their use of inline scripts. Let’s take a look at the three main ways you can insert inline scripts into your HTML. <script type="text/javascript"> $(function () { var inputText = $("#inputtext"), outputMath = $("#outputmath"), inlineMath = $("#inlinemath"); inputText.on("keyup", function () { var expr = inputText.val(); outputMath.text('\\[ ' + expr + ' \\]'); inlineMath.text('The expression is <\\( ' + expr + ' \\)>.'); MathJax.Hub.Queue(["Typeset", MathJax.Hub, "outputmath"]); MathJax.Hub.Queue(["Typeset", MathJax.Hub, "inlinemath"]); }); }); </script>

s Den - Tweak Touch Behavior in Internet Explorer with User Style Sheets Apr 5, 2013 As touch becomes a more and more prevalent means of interacting with PCs as well as phones and tablets (I'm typing this on a Lenovo Carbon X1 Touch laptop), developers should be aware of how to create touch-friendly sites and apps that help users make the most of touch-enabled devices. If you're building apps for the Windows Store, there's good guidance available on touch interaction design on the Windows Store developer center. There's also some guidance available for building touch-friendly sites in Internet Explorer 10. One interesting piece of that discussion is the –ms-touch-action CSS property, which defines the default behavior for the browser's response to touch. If you're a developer, it's easy enough to add an appropriate CSS style rule to prevent double-tap-zoom on the canvas element in your game, like so: 1: #myGameCanvas { 2: -ms-touch-action: none; But what happens when you run into a game where the developer hasn't provided such a rule? A Word of Caution Conclusion

Crocodoc We recently launched a preview of Crocodoc’s newest document to HTML converter. If you haven’t checked it out yet, go play with our preview and see how we’re converting the pages of your documents to embeddable SVG and HTML. What does the new converter mean to those of you building web applications using Crocodoc? Simple: your documents will load faster, look sharper, and be much easier to customize. Our preview page is full of interactive examples designed to help provide inspiration and showcase what is possible with the new Crocodoc: everything from a 3D page demo, showing off the many layers in a document, to a magnified view of an uploaded document, and a thumbnail that expands into a full-size inline document. For this post, I’d like to focus on the 3D demo. Note: the demos in this blog post require IE 9+ (preferably 10), Firefox, or any WebKit browser. Building the 3D Demo Just want to play with some code? Step One: Proof of Concept The Page Demo #1: The Page Adding Transitions Wrap Up

Advanced cross-browser flexbox By Chris Mills Introduction The CSS Flexible box module level 3 — or Flexbox for short — brings with it a lot of power and some very exciting possibilities for web development, allowing us to put together complex site layouts easily and rapidly, and dispensing with some of the illogical hacks and kludges that we've traditionally used. I dealt with the basics of Flexbox in my article Flexbox: fast track to layout nirvana? Introducing the example The example I have built for this article looks like Figure 1: Figure 1: An image of the final layout example This has multiple levels of flexboxes contained within it. The overall layout The basic layout of the site is like this: The <section> is set to display as a flexible box like so: Note: Different IE-specific properties are specified at the top of the rule because IE10 currently supports different flexbox syntax (from 2011) to the latest spec supported by Opera and Chrome. Child flexboxes Next comes the magic moment. Conclusion

Printing The Web | drublic Hey there… This post is 398 days old. It was written on 25.03.2013. Please make sure to be careful with the information provided and check a more recent source on this topic. While it is possible to consume nearly all means of content on your smartphone or tablet it seems like the dream of a paperless office comes true for a lot of web developers. But digital natives are not the only ones who are on the web. Disclaimer: This article was first published in the German Screen Guide Magazine #15 (September to December 2012, pages 77 to 79). The basics of a print style sheet should already be well known by most web developers. a separate file included in the HTML that carries all CSS for print media <link rel="stylesheet" media="print" href="css/print.css">a special media query which targets print mode and is integrated into your regular stylesheet @media print { … } Remove Clutter In general focusing on the main content of a web page is very important when it comes to print style sheets. Thanks

Essential tools for every web designer Every web designer requires the right tools to do their job. To create well crafted original designs you certainly need to be inspired to do so. Getting to that point is sometimes the hardest challenge in the field of web design. Luckily enough for us and our fellow design community there are tools available to assist in completing the job quicker and more efficiently. Below, I have outlined a list of tools I recommend for any web designer. Color Adobe Kuler (free) A great tool offered by Adobe which allows members to upload, create, and edit color schemes of their choice. Pictaculous (free) From the creators of Mailchimp comes a color palette generator different to any other. Colorzilla (free) ColorZilla for Google Chrome is an extension that assists web developers and graphic designers with color related tasks – both basic and advanced.ColorZilla includes a Color Picker, Eye Dropper, Gradient Generator and many additional advanced color tools. (free) Hues ($2.99) Typography

A comparison of Angular, Backbone, CanJS and Ember - Sebastian's Blog Selecting a JavaScript MVC framework can be hard work. There are so many factors to consider and so many options out there that selecting a framework can be overwhelming. To have an idea of all the possible alternatives have a look at TodoMVC. I have had the opportunity to use four of these frameworks: Angular, Backbone, CanJS and Ember. So I decided to create a comparison to help you decide which one to use. To each factor I have assigned a score between 1 and 5. Features There are really important features a framework should have to provide the necessary foundation to build useful applications. Observables: Objects that can be observed for changes. Routing: Pushing changes to the browser url hash and listening for changes to act accordingly. View bindings: Using observable objects in views, having the views automatically refresh when the observable object change. Two way bindings: Having the view push changes to the observable object automatically, for example a form input. Scores Angular

Automatic Table of Contents Any long page of content with distinct and well marked up content can benefit from a table to contents. A table of contents provides a quick way to jump down the page to the desired section. Of course you can create a table of contents manually, but it may be smart to build it dynamically on-the-fly with JavaScript. This is true for several reasons: It's easier - write the JavaScript once and it can create the Table on Contents on every page you need it.It's more reliable - the JavaScript isn't subject to authoring errors.It's still accessible - A table of contents is good for the general concept of accessibility, but it is a bonus (not having it doesn't ruin the page) and nearly all screen readers run JavaScript. This kind of thing has been done many times and many ways. HTML: Headers and IDs A long page of different parts you wish to link to could be marked up a bunch of ways. <article><h3 id="question-one">Title of Question</h3><! A link like this: A list in that <nav>? Demo Share On

The flat design trend - where to from here? — Design/UX I’ve always subscribed to the Swiss style of less is more, so wholeheartily embracing this era of flat interface design. Given the design excesses of the past decade, it’s interesting to see how we’ve come full circle to reach this point. But I can’t help wondering – where to from here? When I started designing websites back in the year 2000, all the world was flat. From here a host of web design trends emerged, first embraced, then vilified by the design community. It always surprised me how wholeheartedly Apple embraced skeuomorphism, given their clean and minimal design ethic. iBook’s faux wood bookshelf and iCal’s moleskin ‘hand-stitched’ leather binder, while initially enchanting now seem terribly passe. Flat design is quickly being adopted by market leaders. There is something about this design ethic that feels honest. Layervault, an early champion of flat design have gone as far as calling this “The Honest Design Age”. These changes aren’t all about fashion.

Easily center text vertically, with SVG! These days, we have a number of different ways to vertically align text in a container of variable dimensions: Table display modesFlexboxinline-block hacksWrapping the text in an extra element and absolutely positioning it…and probably many others I’m forgetting However, often comes a time when neither is suitable, so here I am, adding yet another option to the list. It all started when I discovered the text-anchor SVG property. One issue was that this centered the baseline of the text, so I tried to find a way to shift the baseline appropriately. In addition, this method has the following drawbacks I can think of: Extra markup (namely 2 elements: <svg> and <text>)If the text is more than one line, it won’t automatically wrap, you have to do it manually.Some new-ish CSS text properties may not be applied. However, it has a few advantages too: You can see and play with the result in the dabblet below: Verified to work in at least Chrome, Firefox, IE9+.