Web Development: Beginning Javascript

Published on Mar 23, 2009   //  Development

Web Development

Starting up our mini-series on Javascript, we’ll be covering some of the basics of Javascript today. Javascript’s syntax was designed to allow non-programmers to add interactively and dynamic content to a webpage, without a prior understanding of a complex programming language. Javascript is able to interact with HTML elements on a webpage. It is capable of reading their content and manipulating them.

Javascript can either be used directly in a web page, or it can be in an external file. Javascript can be added practically anywhere within a document, but should be kept within the head or right before the end of the body. Many people prefer to add Javascript to the end of the document because it won’t slow down the loading of the page as much (since the Javascript won’t be rendered until later in the loading/rendering process).

When using Javascript directly in a document, it needs to be wrapped in special tags. These tags tell the browser to render the contained code as Javascript. We use the following tags to tell the browser this:

[code='xml'][/code]

Furthermore, we also need to add some markup between the script tag and the Javascript code. This will ensure that older browser that do not support Javascript will not output the Javascript code to the browser (it will just ignore it). While there aren’t very many users of browsers that do not support Javascript anymore, we still generally do this (if just for historical/legacy reasons).

[code='xml'][/code]

Yes, they’re almost identical to HTML comments, and that’s the point. Non-Javascript supporting browsers will just see the Javascript code as an HTML comment, and just ignore it. Since these comment tags are in the Javascript specification (which is actually called EMCAScript), modern browsers will ignore the tags, and render the Javascript.

We can also add our Javascript to an external file and load that file into our webpage. This is generally done with large amounts of Javascript, to keep your webpages source cleaner or if you plan on distributing this Javascript. Many people recommend moving Javascript to an external file to “optimize” your webpage, but you should form your own coding styles and opinions on that. Javascript external files use the extension .js and contain just Javascript code. We can load this external file into our webpage like this:

[code='xml'][/code]

Which will tell the browser to load the file external-javscript.js into the webpage. These paths are relative to the current URL.

Next week we will continue our mini-series on Javascript.

Great Gadgets: Canon PowerShot SX110IS

Published on Mar 23, 2009   //  Gadgets

canoncam

I love having a camera with a lot of optical zoom, because it means that you can take beautifully detailed pictures without actually being too close to the action. This is great for when you’re at a concert or visiting the zoo, for example, because it’s just not possible to get any closer to the subject of your photo. However, most ultrazoom cameras have the problem of not being quite as pocketable. That barrel can get a little bulky.

While it certainly isn’t as compact as some of the super-slim cameras out there, the Canon PowerShot SX110IS is much more friendly on your jacket pocket than similarly-equipped ultrazoom point-and-shoot digital cameras.

Available in your choice of silver or black, the Canon SX110IS features 10x optical zoom, 9.0 megapixel stills, optical image stabilization, advanced face detection technology, red-eye correction, a big 3.0-inch LCD screen, and easy connectivity to any compatible Canon SELPHY Compact Photo Printer.

Check out the Canon PowerShot SX110IS Digital Camera on Amazon.ca where it is currently selling for $256.49 with free shipping.

Weekend Projects: Log Check

Published on Mar 21, 2009   //  Weekend Projects

Weekend Project

This week our project will be to check our error logs and clean up those errors.

To start login to cPanel and click on Error Log. This will bring up a list of the last 100 or so errors.

One of the most common errors you will see in the log is a File does not exist robots.txt. This is easy to fix by simply adding a blank robots.txt file in your public_html and subdomain folders. If your not sure what should go in a robots.txt file we have added some examples in the wiki.

If you see any errors in the Error Log go through and fix them so that you can ensure your visitors are finding the right page of your site.

If you get stuck let me know in the comments.

Friday Funny

Published on Mar 20, 2009   //  Cartoon

A cartoon created by artist Rob Cottingham.

 linkedindating

If you have an idea for a future comic or would like to submit your own BlueFur cartoon let us know in a comment.

In The Sphere: Twitter, Blogging, Branding

Published on Mar 20, 2009   //  In the Sphere

It’s the first day of Spring, so it won’t be long before you can venture to the local park, set up your picnic, and listen to the birds singing all around you. It won’t be long before you can smell those fresh flowers and enjoy some warmer weather. In the meantime, you can stay parked in front of your computer to improve your skills with Twitter, with blogging, and with branding.

Buzz Bishop starts us off with a discussion of how to use a company Twitter account. Many corporations and businesses are starting to recognize the potential of using Twitter for their companies, but some of them seem to miss the boat altogether when it comes to proper use and etiquette.

Ewdison Then keeps on the cutting edge of technology with his family of tech-minded websites, so he probably gets most of his news online. In considering this, he is discovering the rapid death of traditional newspapers. Do you still prefer the dead-tree edition of the news or do you rely more on Internet sources to stay in touch with the rest of the world?

Jonathan Morrow doesn’t seem to have any trouble with the words, but there are a lot of people out there who want to get involved in the blogosphere who also happen to lack skills in the writing department. How do you blog if you aren’t very good at writing? Sometimes, you just have to consider the alternatives, like podcasting or video blogging instead.

The Keyword Academy isn’t just about finding the right keywords and cashing in on their potential. You also have to get your site noticed in the search engines in the first place. In one of the more recent articles, the academy teaches us about what to do when your site gets sandboxed. Getting stuck in the sandbox isn’t the end of the world, but you do want to get out if you want to profit from your site.

James Chartrand recognizes the value of branding, but personal branding can also prove to be a huge pitfall for freelance writers, designers, consultants, and other people who aim to build up their name in their respective industries. How can you switch from personal branding to business branding and why would you want to? The transition may not be easy, but it may be necessary if you want your business to grow.

Moving Beyond SSH: Email

Published on Mar 19, 2009   //  Development

Moving Beyond SSH

Web server wise, we currently have the essentials all setup. However, we’ve yet to do anything about email. Currently, your web server should be able to send email via a script or through the command line. But, we cannot create email accounts and send/receive email to them. Today we’ll be talking about our available options for email.

Running a mail server on our server can be very taxing. Sending, receiving and SPAM filtering email can be very resource intensive, eating up a lot of CPU time, making our server slower. Additionally, running a mail server requires a lot of maintenance on our end, such as keeping our SPAM filters up-to-date, etc. Also, the webmail programs available just aren’t very good.

Unless you’re a total control freak, running our own mail server just isn’t worth it. I recommend outsourcing our mail servers to Google Apps. This way Google does all the hard work, and we just sit back and enjoy the best webmail interface (in my opinion) and many other services Google offers. Google Apps offers you all the benefits of running your own mail server (email addresses at your domain, POP/IMAP access) plus you get 7GB+ of space and useful services integrated with your email account (like Google Calendar and Google Talk).

Luckily, Google offers a standard edition of Google Apps, so all this is available for free. Letting Google manage our mail server is looking mighty good, isn’t it? Google Apps does have a few downsides. You’ll only allowed to create 50 email accounts per domain, and Google Apps accounts are per-domain. So if you want to have email accounts for another domain, you’ll need another Google Apps account (unless you’re okay with sharing the same email accounts on multiple domains).

Setting up Google Apps is extremely simple, all you have to do is sign up and follow the instructions provided (verifying your domain ownership and setting up the DNS records to allow you to use Google Apps). To setup the DNS records, login to Webmin, navigate to Servers > BIND DNS Server, click on the appropriate zone for the domain you’re setting up, then click on Mail Server. For each MX record the Google Apps instructions give you, leave the Name field blank, but fill in the Mail Server and Priority fields with the provided records and press the Create button. After that, click Apply Zone then Apply Configuration in the top-right corner of the Webmin page.

There you have it, a fully managed mail server for free. Go forth and enjoy the benefits of using Google Apps as opposed to setting and managing up your own mail server.

Page 4 of 12« First...23456...10...Last »