Monday 28 February 2011

CSS: Custom fonts with CSS3 (@font-face)

   


CSS3 is being slowly introduced in our beloved web design world. I say 'slowly' because in reality some of the new properties are already implemented in the latest web browser versions.
One is the @font-face rule. Interestingly enough, I've published something about custom fonts in web pages using JavaScript. With @font-face everything is easier.
Let's see how it works!

Friday 25 February 2011

ASP: Content rotator component

   


Please, raise your hand if you know anything about asp content rotator.
This is possibly the less known component available since the introduction of asp 3.0... and possibly the less used. In fact, the component could be used in different situation, and it is worth knowing a little bit about it.
The content rotator component creates an object used to display different contents every time a visitor views your page. Not that bad, isn't it? I've already published a post about random quotes... remember? We are actually talking about something very similar, but - someway - simpler.

Wednesday 23 February 2011

JavaScript: create a basic text editor for textareas

   


In this post I will explain how to create a very basic editor to be used for textareas. And we are going to create it using JavaScript.
I won't write down all the code, for every single possible function, however the example will be the basic structure which you can then use for whatever you might need.
First of all, some assumptions:
1) in your page there's a form and a textbox (wow that was easy!);
2) the text in the textarea is submitted to your database with html tags that are then rendered when the text is displayed in other pages.

Monday 21 February 2011

HTML 4.01 & HTML 5: deprecated and not supported tags

   


As you may already know we are near the introduction of HTML 5, even if it is not a W3C recommendation yet. It is quite clear that browsers will not stop understanding HTML 4.01 tags, probably for a long time, however it is time to start thinking about what will be or it is already deprecated in HTML 4.01 and HTML 5. The new version will improve "interoperability and reduce development costs by making precise rules on how to handle all HTML elements, and how to recover from errors.
Some of the new features in HTML5 are functions for embedding audio, video, graphics, client-side data storage, and interactive documents. HTML5 also contains new elements like <nav>, <header>, <footer>, and <figure>.
The HTML5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and many hundreds of other vendors." (quoted from W3C web site)
That is actually very interesting, but it could pose some issues. In fact, if you think about the code you wrote in the past years, it could be that many times you used already deprecated tags. That means you should go back and change all your code. HTML 5 ready browsers will continue to interpret old tags, otherwise millions of web sites would stop working correctly. And nobody wants that to happen.
So, you can still sleep tight, however it is important to know what will happen.

Friday 18 February 2011

JavaScript: Custom fonts for your web pages

   


"I wish I could use a particular font on my home page." Have you ever thought about that? Have you ever wondered how that page would be if a custom font was available?
Now you can. And it is quite simple.

Typeface.js is a 24 kb library. With it you can embed custom fonts in your web page without using images or Flash movies. In the past, when someone needed to create a label with a custom font, an image would have been the solution. I used to create small images for specific labels, but - I must admit - it has always been a pain. When doing it, you have to be very careful, in order to make all labels consistent. When the site is multilingual, the time needed to create those labels, increases incredibly. The result? In my opinion, it is almost always inadequate.

Wednesday 16 February 2011

Introducing polls

   


As I can see from the stats, visits to The Web Thought have increased quite a lot lately. Despite the fact that almost nobody leaves comment to my articles, I would like to introduce polls. I don't know if you like polls - I usually don't - however, please help me to understand what are the most interesting topics you would like to see in this blog.
So please, cast your vote, using the panel on the right!

Monday 14 February 2011

SQL Server: apostrophes in queries

   


Apostrophes ( ' ) in queries might be a big problem. In fact, we usually build our queries without thinking about it, maybe because it's quite unusual to have data containing such strange characters. That leads to difficulties in isolating the cause of an error while executing a query statement, especially when the query worked for a year and then - suddenly - starts giving problems. It is quite common not to think about new data recently entered or updated, and usually we concentrate on the query statement and thus - let me say - waste a lot of time/money.

Friday 11 February 2011

ASP: How to create custom filters for your tabular data

   


Displaying data in a table is the most used and easiest way of publishing information for the user. It is quite common in web app and sites, that a query resulting recordset is displayed in a tabular form.
In this short article I will explain how to apply custom filters to the recordset, based on users requests. In order to show you how to do it, I need to explain a bit where to start. Our table could be something like:
IDPRODUCT FAMILYDESCRIPTIONCODECOLOURTYPE
1BottleGlass bottle1234GreenProduct
2BoxCarton box5678BrownPackage
The table could go on with all the products. We are going to create links inside the table to filter data.

Wednesday 9 February 2011

ASP: Multilingual web sites (AddHeader, CodePage and CharSet)

   


I've been working with multilingual web sites for a long time and - believe me - they sometimes are not so easy to manage. At the moment, one of the sites I manage, lets the user choose between 8 languages (including Cyrillic).
One of the issues you might have to face when dealing with languages, is how to manage charsets. I know there's a lot of talking about it, especially in relation to specific browsers and characters rendering. The only thing I remember is that it was a real pain! Being completely sure on how the web page was rendered seemed to be almost impossible.

Monday 7 February 2011

Check Browser Compatibility

   


When creating a new web site, it is very important to check browser compatibility. Sometimes customers are not really aware of the implication of that issue, but as developers, we know how important is a good cross browser compatibility. It is undeniable that we cannot have every available browser installed on our testing server, not to say every single version. That is why we have to rely on an external tool in order to actually see how the highest number of browser will render our beautiful new web site.
I discovered a useful site to do it. And I would like to make you aware of it, so that you can use it to test your work.

Friday 4 February 2011

jQuery Tools: The missing UI library for the web

   


Today I would like to share a incredibly rich site, where jQuery is used to create useful and ready made tools. The place is:

Wednesday 2 February 2011

SQL Server: Stored Procedures and variables problem

   


In my last post I published a step-by-step guide to create Stored Procedures in SQL Server using SQL Server Management Studio.
There are some things I would like to add, because in my experience I sometimes got stuck with errors that - when solved - were so easy to pinpoint, while little information can be found in tech forums or generally in tech sites. Specifically there is a common problem with the @query variable and its length.