basic

You are currently browsing the articles from cloud #0 matching the category basic.

the making of a webdev - 1

I wrote the first html page like this:

<html>
<title> Hello </title>
<body> <h1> Hello World </h1> </body>
</html>

I showed the code to my fellow senior webdev and was immediately brought to the attention of using proper “doctype” declaration, which looks like this:

<!DOCTYPE HTML PUBLIC “-//W3C/DTD HTML 4.01 //EN” “http://www.w3.org/TR/html4/strict.dtd”>

So the story goes like this: Use of appropriate “doctype” makes the browser behave differently as the scenario demands. In “strict” doctype, browser renders the page as per W3C’s specifications and the browser is said to operate in what is called as the “standards” mode. In certain other cases like when you don’t specify the doctype correctly, the browser falls back to imitate older browsers (which do not adhere to W3C spec) - this behaviour of a browser is “quirks” mode operation.

My question then came: “How do I detect what mode a browser is currently rendering a particular page in?” There must be a Firefox extension or some other code/script which can tell me this mode. I didn’t get an answer and I still do not know what is the right way to do this. (After note: read my update in the bottom of this post)

Then there are two other types of doctypes, other than “strict”. They are the “transitional” and the “frameset”. The use of “transitional” comes into play when you want to use presentational attributes in markup and certain presentational markup tags like <font> <strike> <u> etc.. In all ways, using “transitional” doctypes should be avoided, as the presentation can be very well done with the use of CSS. In the semantic markup world, (we will see what this is, sometime later) CSS is for presentation and markup is just for meaningful grouping of content. So, a good webdev should try to use “strict” doctype. :-|

If you want to refer to the exact syntax of the doctype magic line that you would use, refer w3c’s site[1]

[1] http://www.w3.org/QA/2002/04/valid-dtd-list.html

I’m not sure what “frameset” doctype means. I just know that “<frameset></frameset>” will be used in the place of “<body></body>” tags. I’ve never attempted to use these frameset tags, so I don’t know what the browser does with it.

So, the first headache that I cleared in my webdev world is to make sure that I communicate to the browser how to read my code. I did byheart this magic line and put it in the very beginning of every html page that I write:

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 //EN" "http://www.w3.org/TR/html4/strict.dtd">

UPDATE:

How do I figure out what mode a particular page is rendered on?
———————————————————————

Alright, a few of my friends updated me on how to figure out the Quirks mode. Its quite easy — in Firefox, Tools > Page Info (Ctrl + I) displays the “Render mode” of the browser, like this:

How to find out rendering mode of a page in Firefox

This site[2] has a nice bookmarklet which alerts you to say if the page is rendering in “Standards” mode or “Quirks” mode. By the way, if you do not know what a bookmarklet is — read on, others can skip this paragraph. When you go to the site[2], you will find a link that calls itself the bookmarklet (on the bottom of the page) which you should right click and add to the bookmarks toolbar. Then when you are in a page whose mode of rendering you want to figure out — just click on that bookmarklet, you’ll geta javascript alert (popup) saying the mode of rendering of that page.

[2] http://dorward.me.uk/www/bookmarklets/qors/

Written by thanix on November 29th, 2007 with 1 comment.
Read more articles on basic and webdev.

the making of a webdev - 0

I was thinking for a longtime to compile all the stepping stones that I encounter in my webdev (web developer) world in a collection called “the making of a webdev“, so this attempt. In all weirdness, this would come out as a naive man attempting to learn to code the web. I call it weird, because I, being a webdev, present this series/compilation so naked that you could find ample chances to call out “hey, you are a webdev?, really?” This comes with great amount of instinct, mistakes, practical usecases, inherited code, hearsays and a lot other, possibly “garbages” that got dumped when I listened with my “webdev” ears.

An artist becomes a “pro” by painting for money, the same applies for every other career. A “pro” has an exceptionally different knack, style and devotion attached to what he does, that really makes him a “pro”, much diffferent from someone who does it for hobby, the amateur hobbyist. Well, there are exceptions, but I’m talking of the larger class.

Probably, there is a lot more of you who haven’t coded a website, but think you make a decent “webdev” on the surface of your minds. Probably, you wrote simple, table-based HTML page, with or without using the so called tools like FrontPage, dreamweaver, and others. I was pretty much thinking like you and when I attempted to bring some content for a near “awesome” site, I drained out, I soon, found that I’m nowhere near the webdev zone. This is simply because web is no more 1.0, infant. It’s a grown up 6th class(grade) child now, I had to handle it in its own way, much different from how I’d handled it earlier.

I’m sure, this wouldn’t be like a powerpoint silver bullet or a tutorial or a training handout. This is more likely of the kind of sharing the know hows, whys and whats. Life is a relative phenomenon, so is what appears “simple” and “complex”. Somethings here might appeal to be drop dead “simple” and certain others very “complex”. I’m sure you will appreciate and take it in the right tone, as these are relative depending on one’s skill, experience and knowledge. I want to make sure that you take me to be standing on the same plane as yours — meaning this article here appears because I initiate it here, other than the fact that I initiated, there is nothing really that differentiates you from me. You could have better ways of putting out things, better skilled and better experienced in the same thing that I spit here. In that case, please open up the discussion through comments. I do not even claim to be the author of this series.
Lets being the roll from the next post, keep watching! :-)

Written by thanix on November 27th, 2007 with no comments.
Read more articles on basic.

No older articles

Newer articles »