JavaScript
  Home arrow JavaScript arrow Handling Multiple Web Page Elements with D...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-09-24

    Table of Contents:
  • Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript
  • The complete source code of the original text replacement application
  • Replacing multiple web page elements
  • Putting the full text replacement application into a single file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Handling Multiple Web Page Elements with Dynamic Text Replacement with JavaScript


    (Page 1 of 4 )

    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.

    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!

    More JavaScript Articles
    More By Alejandro Gervasio


       · In this second tutorial of the series, the signature corresponding to the JavaScript...
       · Yeah this is great, but how does one do the most useful feature of text replacement,...
     

    JAVASCRIPT ARTICLES

    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT