Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- How to Master JavaScript


JAB_Creations - 4:03 am on Oct 21, 2010 (gmt 0)


Best advice?

Use XHTML as actual XHTML, which means serving pages as application/xhtml+xml so you can't use document.write as you're not supposed to in the first place; use alert() for debugging.

Don't use innerHTML, it's total junk and is completely unreliable; stick to using the DOM and all the element methods that for some reason refer to elements as nodes (just how amateurs refer to elements as tags).

Don't put scripts in the body element, put them in the head element; people will say that hurts performance, it doesn't but what it does do is NOT allow lazy coding practices.

Don't use frameworks EVER. They don't work when things get mission critical, they're wholly unreliable, and they easily alienate dial-up users who have more market share then IE6 in the US/UK/etc.

Lastly learn about rendering engines and use the big four: Gecko/Firefox, Presto/Opera, Trident/IE, WebKit/Safari. They each have strong points to test with JavaScript and their error consoles including IE. Opera really shines in this area and will catch lots of stuff that Gecko won't. Use and test with them all. I test with Firefox primarily though I use Opera for testing on pretty much a daily basis. Nick those warnings in Firefox too, leave no error unfixed!

You simply can't go wrong with my advice if you spend some time and work on your own personal projects. Set your goals of course though keep them reasonable and so long as you manage your time wisely you should do much better then you thought you ever could.

- John


Thread source:: http://www.webmasterworld.com/javascript/4216573.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com