Forum Moderators: open
Hi
I am a want to be professional web page designer. Have been studying HTML and CSS intensely. Have studied some JavaScript too but not nearly as intensely. I am having trouble seeing many good uses for JavaScript. I know you can use it for form validation which is a good use. However roll overs and even pop-ups seem to be best handled with CSS. I read an article on writing JavaScript to rewrite your CSS to move Nav from the left to the right under the control of a person viewing a web page however when really would you design a page like that. I have been thinking of moving on to PHP and mySQL even before studying the subject of JavaScript to an intense level. So please give me some guidance as to where you use JavaScript on your pages which can best be done with JavaScript and is not a thing you would design into a page once in a million years.
Very truly
Marc
javascript is excellent for:
client/browser statistics reporting *
click tracking *
AJAX, anything "load-on-demand" **
manipulating the DOM **
calculators
sniffing for plugins
form validation
other DHTML effects
* = used it on every page I create
** = used often
programming javascript is an essential skill I'd require of any web developer. It's an integral part of the browser, which as a web developer is your primary medium. I'd say a developer who doesn't know javascript is like a painter who doesn't know green.
There are many server-side languages to choose from, but there is only one javascript (which admittedly comes in a few browser flavours).
Colouring alternative rows in a table...
One 'effect' I have started to use recently, which is great for JavaScript, is simply colouring alternate rows in a table a different colour. You can step through a <table> element and add a class called 'odd' (or something) to every odd row. That class is then defined in your CSS - so presentation is still in the CSS. It then doesn't matter whether you add or remove rows in your table, it will be ok. This function can be very generic so it only ever has to be written once and it will work on any table. Something which is best kept out of server-side scripting (PHP...), since you would have to manually incorporate it into every table you generated. And trying to manually edit your HTML each time is a nightmare.