Wednesday, 30 March 2011

jQuery: selectors

   


If you are new to jQuery, you might be quite confused by the terms used to explain the famous library. On the other hand, if you've started to look into jQuery recently, there's one thing that is very important and that you should understand thoroughly: what are and how to use selectors.
When manipulating HTML elements in a web page, we need to be sure to select the correct element. Selectors are what you need. I know that this is the basic: without knowing what selectors are, we wouldn't be able to do almost anything with jQuery. However there are some things you might not know yet about selectors.

Monday, 28 March 2011

CSS: conditional statement

   


I usually write my CSS style sheets and check them with Firefox. It is probably due to fact that I use the Web Developer toolbar to check the resulting effects. When everything is exactly the way I want it, I start checking the result with IE, Chrome and Safari. Normally, there is no problems, however some times I find glitches, especially with IE 7 or IE 6.

The golden rule
First of all, let me tell you a thing that developers think it is some sort of golden rule. Every web site must look the same with any browser. That is not true anymore. Or, let me put this way, that principle is not an absolute rule anymore. With the introduction of CSS3 and HTML 5, developers have concluded that it is not a sacrilege to have different looks with different browsers. Do not jump to strange conclusion: I am not saying that we will have completely different sites for different browsers. However, we might accept that some particular effects (generated by CSS styles) would be visible only to users with updated browsers. For example, you may already know that IE9 will be available only for Vista and Windows 7. Win XP users will stay with IE8. Those users will eventually upgrade to a newer operating system, but in the mean time, they might not enjoy CSS3 or HTML5 new features. We will have to cope with that, it is a fact.

Friday, 25 March 2011

Google Analytics

   


I've been using Google Webmaster Tools for a long time, but just a few months ago I've started to have the feeling that it was not enough. What I wanted was something that could analyze my web site traffic source, visitors, search engines and so on, giving a clear idea on how my web site was performing. Thus I approached Google Analytics.

Wednesday, 23 March 2011

JavaScript: special characters

   


JavaScript code is full of special characters. When coding, you will end up using a lot of apostrophes, quotes and so on. Let me explain it through a simple example.
<script type="text/javascript">
document.write("John said "Cheers!" while raising a glass of wine.");
</script>
As you may noticed, in the above code we have a series of quotes. The first one is defining the starting point of the string we want to output, while the last one is the ending point. Just to be more clear, the red quotes are the boundaries of the text string, while the green ones should be part of the string itself. If we use the above code, an error will be the result, because the first green quote will be interpreted as the ending of the string. That is as if the string is cut like:
John said
leaving the rest
Cheers!" while raising a glass of wine.
out.
How to deal with that?

Monday, 21 March 2011

Blogger: a great 2011?

   


According to Blogger Buzz, 2011 will be another great year for bloggers that use Blogger - no pun intended. New features and improved usability will be released during in 2011, while 2010 has been a great year, with an incredible growth rate. The features available to bloggers have increased and blogging experience has been made significantly deeper and easier. New widgets and options have been introduced, while a completely new dashboard will be released in 2011.

The new dashboard will have a new interface that - according to Chang Kim, Product Manager of Blogger - will make things much easier to bloggers. As an example, the new post editor will be completely revised. From the posted images it is quite difficult to understand the new features, however it seems that the overall usability will be increased.

Please see the Blogger Buzz post for more information.

Friday, 18 March 2011

CSS: positioning

   


Positioning of elements inside a page could be quite tricky. Nevertheless, it is a powerful way of creating wonderful layout and it gives freedom and flexibility. I would like to explain everything you need to know in order to use the correct method to place your elements using CSS styles.
First of all, let me point out that there are four method for positioning:
  1. static: this is the standard way of positioning; the element will be displayed following the normal flow of your page;
  2. fixed: a fixed positioning will place the element in a fixed position; the element won't move even if you scroll down the page;
  3. relative: with a relative positioning the element will stay relative to its normal position;
  4. absolute: the element will be positioned relative to the first parent that has a position other than static; if there's not such element, <html> will be that element.
Let's go in depth and see how they work.

Wednesday, 16 March 2011

Web Sites: how to keep things tidy (with style sheets)

   


Almost three years ago, I have inherited a web site management. That web site was developed by a third party (a not-so-much-skilled web designer), using a mixture of different programming languages (JavaScript and VBScript) supported by CSS style sheets. In the past days, I've been asked to revamp the web site. Mainly, they asked for a change of colors... well, actually they wanted to obtain some sort of negative image of the web site. That means changing the black into white, and the whole grey color palette.
I am sure some of you will think that it's quite an easy task to do. And that's true... just when you (or your predecessor) have kept the things tidy!