Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Archive for October, 2013

Adding Javascript to your website

Friday, October 11th, 2013 by Servage
JavaScript allows you to create highly responsive interfaces that improve the user experience and provide dynamic functionality, without waiting for the server to load up a new page. For example, we can use JavaScript to do any of the following: • Suggest the complete term a user might be entering in a search box as he types. You can see this in action on Google.com. Request content and information from the server and inject it into the current document as needed, without reloading the entire page—this is commonly referred to as “Ajax.” • Show and hide content based on a user clicking on a link or heading, to create a “collapsible” content area. • ...

CSS layout techniques

Tuesday, October 8th, 2013 by Servage
Page Layout Strategies Before we start dissecting CSS layouts, let’s talk about the various options for structuring a web page. As you know, web pages appear on browsers of all sizes, from tiny phone screens to cinema displays. In addition, users can resize their text, which has an impact on the layout of the page. Over time, several standard page layout approaches have emerged that address these issues in various ways: • Fixed layouts stay put at a specific pixel width regardless of the size of the browser window or text size. • Fluid (or liquid) layouts resize proportionally when the browser window resizes. • Elastic layouts resize proportionally based on the size of the text. • ...

Advanced web-development with Javascript – Part 1

Monday, October 7th, 2013 by Servage
The Anatomy of a Script Originally, JavaScript’s functionality was mostly limited to crude methods of interaction with the user. We could use a few of JavaScript’s built-in functions to provide user feedback, such as alert() to push a notification to a user and confirm() to ask a user to approve or decline an action. To request the user’s input, we were more or less limited to the built-in prompt() function. Although these methods still have their time and place today, they’re jarring, obtrusive, and—in common opinion, at least—fairly obnoxious ways of interacting with users. As JavaScript has evolved over time, we’ve been afforded much more graceful ways of adding behaviour to ...

Float and position elements with CSS

Friday, October 4th, 2013 by Servage
There are dozens of CSS properties that allow you to change the appearance of text elements and the boxes they generate. But so far, we’ve merely been decorating elements as they appear in the flow of the document. In this section, we’ll look at floating and positioning, the CSS methods for breaking out of the normal flow and arranging elements on the page. Floating an element moves it to the left or right, and allows the following text to wrap around it. Positioning is a way to specify the location of an element anywhere on the page with pixel precision. Floating Simply stated, the float property moves an element as far as possible to ...

Building forms with HTML

Thursday, October 3rd, 2013 by Servage
Text entry controls One of the most common tasks in a web form is to enter text information. Which element you use depends on whether users are asked to enter a single line of text (input) or multiple lines (textarea). Single-line text field <input type="text"> Single-line text entry control One of the most straightforward form input types is the text entry field used for entering a single word or line of text. In fact, it is the default input type, which means it is what you’ll get if you forget to include the type attribute or include an unrecognized value. <li><label>City <input type="text" name="city" id="form-city" value="Your Hometown" maxlength="50"></label></li> Multiline text entry field <textarea>...</textarea> Multiline text entry control At times, you’ll want ...

Learning about Javascript

Tuesday, October 1st, 2013 by Servage
In this section, I’m going to introduce you to JavaScript. Now, it’s possible you’ve just recoiled a little bit, and I understand. We’re into full-blown “programming language” territory now, and that can be a little intimidating. We’ll start by going over what JavaScript is—and what it isn’t—and discuss some of the ways it is used. The majority of the chapter is made up of an introduction to JavaScript syntax—variables, functions, operators, loops, stuff like that. Will you be coding by the end of the chapter? Probably not, but you will have a good head start toward understanding what’s going on in a script when you see one. What Is JavaScript? If you’ve ...