Wednesday, June 11, 2008

This blog has moved to a new location

Dear visitors,

This blog has been moved to a owned domain and hosting. Please visit us at out new location www.w3hobbyist.com

Thank you.

Tuesday, January 22, 2008

Web 2.0 or exaggeration ?

I think its more of a fad than a reality for many. Web 2.0 aims at giving the user a very friendly reception and stay without compromising/exaggerating on the ambience and other critical elements in a webpage.

But lately, I have found some web developers throwing up unacceptable pages on the name of 'Web 2.0'. They use flash banners where a simple static image could do. They use javascript to render page content where simple HTMl tables would do, but they won't use AJAX for form submission/input validation(huh?). Isn't this a blunder knowing that SE spiders cannot go well with Javascript. Only I know what toll it takes on my bandwidth and page load time! Some webmasters are trying more and more to make a page 'attractive' at expense of visitors. Tell me if this would be called as 'more usable'

My message here is web 2.0 is about making web pages more usable, not more avoidable. Websites grow more on value offered rather than anything else.

-Rohan Shenoy

Web 2.0 or exaggeration

Saturday, January 19, 2008

A great browser plugin for Firefox/ Flock and Seamonkey : Specially useful for web developers

A great browser plugin for web developers. Change images, CSS, HTML, cookies, forms, resolutions, etc!

All functionalities of this would come handy!

Download and screenshots:
http://chrispederick.com/work/web-developer/

Thursday, January 17, 2008

Print links in printable version using javascript

With screen media, one can easily link pages on the web(Eg:Click here to visit Google . But when a user 'prints' the page, all your links will probably be lost or atleast won't print as you want them. To avoid this, it would be nice if we could somehow bundle the links with the printed matter. That is what I recently wanted for my website and I found that javascript could easily help me.

To see what I mean, see the below screenshot. It is a printable version of one the pages of my website.



The logic is to extract hyperlinks from the body of print matter and list them seperately near the footer. To see a live example, click the "Print this page" link in bottom-right of this page.

You would be shown as printer friendly format of that page with outbound links from the body-matter extracted and put in a seperate area.

So how do we do that?Its simple 3 steps!
  1. Use javascript function to getElementsByTagName. Since we need to get elements with "a" (anchor) tag, we collect all hyperlinks on by document.getElementsByTagName('a'). This will return an array of all hyperlinks in the matter. Lets call this array as links.
  2. Calculate size of the above obtained array using links.length function.
  3. Now lets run a loop that will execute it as many times as the no. of hyperlinks. In every loop, we perform three actions: 1. Get HREF attribute of a hyperlink. 2. Get TITLE attribute of the hyperlink and 3. We print the hyperlink's title and HREF attribute.
So, our code would look like below
var links=document.getElementsByTagName("a"); // returns an array of all hyperlinks
var no=links.length;// Calculates no of hyperlinks
if(no>0) // execute further action only if atleast 1 hyperlink is found in the matter
{
document.write("Important links from this page have been given below. Please visit them:
")
for(i=0;iWe start the loop
{
href=document.links[i].href;//We obtained the HREF attribute of a hyperlink
var title=document.links[i].title;//We obtained the TITLE attribute of the same hyperlink
document.write(""+title+":
=>"+href+"
");} //Now we write the link
}
else
{
false;// return false if o hyperlink is found in the matter
}
To get this method working, you need to have the TITLE attribut for every link in your matter. If you don't have, then you may decide to skip the title and only print the HREF attribute.

Changing structure of your website and hyperlink anchors? Here is what you can do to avoid loss of traffic

For many webmasters, HTML is the first thing they learn when they want to start a website. On a fine day, he is introduced to the superior powers of PHP and other programming languages. Managing a PHP-MySQL powered website is very easy compared to those ever static HTML webpages(ofcourse only if you know PHP at very least)

So when you throw your energies for an upgrade to PHP powered webpages, you realize that this means changing file names. So it is possible that www.yoursite.com/this-is-a-webpage.html is no longer available or is better available at www.yoursite.com/this-is-a-webpage.php.

While it may be easy for you to cope with filename changes, it isn't the case with your visitors who come to your site following a hyperlink from some other webpage, or bookmarks, or search engines, etc. You may change the links on your webpages to suit the new filenames but it would be difficult to manage if you have published your links on many other external webpages and search engines. So your visitors would end up seeing Error 404: File not found and get irritated, and needles to say, they would leave you site!

To solve this, follow these simple 4 steps:
1. Once the upgrade is complete, use permanent redirects(301) to send visitors and crawlers to new location when they request the old location of the file. To confirm that redirection is working, simply type in the old location of the file and you will find it redirecting to the new location.
2. Generate a new sitemap. Sitemaps will be usually be available in multiple formats but lets use XML and HTML formats for this tutorial.
3. Submit the XML sitemap to Google(I assume you are using Google Webmaster Tools).
4. Edit your custom Error 404 (file not found) page and replace it with the new sitemap in HTML format. You could add a small note reading out "Dear visitor, we recentely upgraded and have renamed files in the process. The file you requested could not be found. We have listed all the webpages on this website. Please choose the page you were looking for."

Now, you can sit back and admire your upgraded website without fear of losing any traffic.

Legal documents for a website

Anybody who manages a website will probably know how easy it is to be sued for a minor error. This could very well mean a big hole in your pocket and lots of bad publicity for you. Even if the jury rules in your favour and sets you free, still I am sure your legal aid may not be so lenient. You as a webmaster won't intentionally guide your visitors wrongly but none know when a typo may occur change the meaning of the content. So is there anything you can do about it? Apart from thorough proof-reading and appropriate research, web publishers can safeguard their positions, revenue and publicity by including disclaimer, terms of use, privacy policy, etc. documents on their websites. If you aren't able to create those from scratch, you can find free legal documents template from Website-Law.co.uk.

As an additional exercise, you can study the legal documents of popular websites such as Youtube or observe ongoing and past legal discussions as the DigitalPoint forums.