Ok, so if you want to -completely- get what I’m trying to get at maybe you should have a quick scan over the thread The Dynamic Nature of JavaScript.
And now lets just have a quick re-read over what Jeremy Keith says in his DOM Scripting book on page 80 - Question everything:
Whenever you use JavaScript to alter the behavior of your web pages, you should question your decision. First and foremost, you should question whether the extra behavior is really necessary.
JavaScript has been misused in the past to add all sorts of pointless bells and whistles to websites.
– Blah blah blah, two paragraphs on pop-up / pop-under windows which I never use so irrelevant to use in the quote –
If only someone had asked, “How will this benefit the user?”
Ok let’s get down to business
So I understand that JavaScript is used to alter the behavior of Web pages to enhance the user interface or add useful Web page interactivity and so on. And my understanding on the dynamic nature of JavaScript is greater than before too.
Paul Wilkins mentions in the thread linked above the following statement:
[QUOTE=pmw57;4513514]When using scripting, the best solution is to leave the page content on the page, where it belongs, and then to use scripting to affect the behaviour of the page, which can include hiding parts of the page content until some event occurs later on.[/QUOTE]
But what about the dynamic parts of JavaScript that can’t be added to the markup of the HTML document (I mean the “View Source” HTML markup) such as a JS date script which could also be implemented with a server-side scripting language such as ASP.NET or PHP? Perhaps someone could enlighten me about why people use scripts to display the on Websites when the date can be seen in the taskbar? And why insert it with JS (like the Website of the UK Government Website Direct.gov.uk does) when it can be inserted with PHP and it would actually be indexed (at least thats what I know it to be)? Or is this the same case as most other Websites whereby it may be a credible company / organisation but the Web Designer / Developer wasn’t so credible?
How do you decide whether to use JavaScript or a server-side scripting language to insert dynamic information on to a Web page? Any particular advantages / disadvantages that should be known and taken into consideration?
Thanks in advance!
Andrew Cooper