JavaScript and DHTML – Move Up to an Interactive Website that Brings Visitors Back
JavaScript is the most popular scripting language on the Web. And for good reason. It was designed as a fast way to add interactivity to websites. And it works on all browsers.
DHTML stands for
Dynamic
Hyper
Text
Markup
Language. It's an overall term that describes the methods of making interactive webpages. It uses building blocks like HTML, CSS and JavaScript. Combining JavaScript with HTML code can basically create DHTML.
Why Should I Use JavaScript in My Website?
There are many reasons to use JavaScript. The simplest, and most powerful, is that JavaScript
makes your website more appealing to visitors.
All of its advantages translate into a website that can DO more, in real-time. Every time you've clicked an "Enter Site" button, or seen a "Please Complete the Form Before Proceeding" warning message? That was JavaScript.
Recently a client of ours was torn between JavaScript and Flash. They wanted to put a series of images in the top-right corner of their website, each image fading to the next after a few seconds. They wanted to do this with Flash.
While we could have done that, we pointed out that JavaScript can do the same thing. Only it's faster to develop, it's really easy to add or modify an image later…and the site visitor won't need a Flash plug-in just to see it.
Another client had a long list of FAQs they wanted posted. (And we're talking long.) If they were to put the full text version of the FAQs on the page, it would have been one of the longest pages we’ve ever seen on the web!
So what was our solution? We put in click-to-expand links with JavaScript. When the page loads, the reader only sees a list of FAQ topics. They click on one topic and its answer expands onto the page. Click on the topic again, and the answer contracts. Much easier to scan topics and read that way.
Finally, as we pointed out earlier, JavaScript works in all major Web browsers (Internet Explorer, Firefox, Safari, Opera, even Chrome).
The DHTML Advantage
There's one thing we DON'T do with JavaScript – frame URLs with it. This is because sometimes, search engines can't see JavaScript-rendered URLs.
Where this comes up often is navigation menus. A website's navigation must be SEO-friendly. So we opt not to take any risks.
Instead, PlanetMagpie recommends combining HTML, CSS and JavaScript properly for a DHTML navigation menu. This way we're sure all navigation is 100% SEO-friendly.
JavaScript/DHTML Capabilities
- Interactive Text/Layout: Changing elements on the webpage as visitors work down them. Expand-on-click links, adjustable windows, etc.
- Form Validation
- React to Visitor Actions: Loading a new webpage for example, or clicking on an HTML element in a page.
- Create Cookies: Cookies, as you probably know, store a little information on a visitor's computer. Cookies can record them as a visitor, customize their next visit to their preferences, etc. What you both get from them is programmed in by you – with JavaScript.
- Analytics: Track visitors to the website for use in SEO improvements
When Should I Use JavaScript/DHTML?
- When you want to give your website users a visually engaging user interface and a dynamic look and feel.
- When you want visitors to interact with your website (and come back).
- When you want to validate information from visitors collected on a web form.
- When you need boxes to pop up for problem alerts and/or confirmations of visitor actions.
- When you want a website that DOES more to help your business.
If it's time to build JavaScript into your website, call PlanetMagpie at 408-341-8770. Or email us at
webdev@planetmagpie.com with questions. All consultations are no-obligation.