Home arrow JavaScript arrow Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript
JAVASCRIPT

Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript


If you're an enthusiastic web designer, then you know that text-based web pages can be rather boring to potential visitors. Often, then, you'll find yourself faced with the following dilemma: how do you create eye-catching web page elements that are, at the same time, highly accessible? Keep reading for a solution.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
September 24, 2007
TABLE OF CONTENTS:
  1. · Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript
  2. · The complete source code of the original text replacement application
  3. · Replacing multiple web page elements
  4. · Putting the full text replacement application into a single file

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript
(Page 1 of 4 )

Introduction

The answer to that question is a technique known widely as Dynamic Text Replacement. If you're interested in learning its foundations, you should start reading this article now! Welcome to the second installment of the series that began with "Dynamic Text Replacement with JavaScript." As its name suggests, the dynamic text replacement approach lets you substitute certain text-based portions of a selected web page with attractive images, while keeping its accessibility nearly the same.

Now that I have introduced the subject covered by this series of articles, let me offer you a quick summary on the topics that I discussed in the first article. As you'll possibly remember, in that tutorial I developed a simple JavaScript application to replace the pertinent text nodes includes into all the <h2> headers of a sample web document with a few basic images, in this way implementing the so-called text replacement approach.

The main advantage of this method rests upon the possibility of using different font types, or even polished graphics, to build certain sections of a given web page (its headers, for instance) without sacrificing the level of accessibility offered by text-based elements.

As you hopefully learned by the practical example developed in the previous article, the logic that stands behind the text replacement approach is very simple to grasp. At the same time, however, it provides web developers with yet another way to build appealing yet accessible web sites.

All right, I believe that you now remember how to build a simple text replacement application with JavaScript. However, the initial script built in the previous tutorial lacked some important features, like the ability to replace any element of a web page. Therefore, in the next few lines I'll introduce some minor modifications to the script in question to make it capable of substituting multiple sections of a web document.

Now that I have introduced the theme of this second tutorial of the series, let's move forward and learn how to improve the original text replacement script that I built previously. Let's go!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials