Web Depot: Keep Your Site Unique By Substituting Text

Stephen Yagielowicz

A JavaScript library for randomizing taglines by substituting sentences for each other, swapping only the necessary words, substituteteacher.js is an easy way to be sure that your site’s users see different text whenever they visit — and is a great way to provide fresh descriptions and other information for photo and video content.

The script is simple, requiring the addition of the substituteteacher.js file, the creation of a container element and fallback text, and the script’s initialization. Text variables are stored in an array and easily accessed through an API, which provides control over the sub constructor, which creates a new instance of substitution using a list of sentence strings. Options include specifying a random substitution or using a specific order of text substitutions, as well as the interval and speed of the transitions. A run command lets the script run programmatically, or when a user clicks a button, to start the sentences’ rotation.

Related:  

More Articles

profile

WIA Profile: Karen Tynan

Women In Adult ·
profile

Q&A: Adrian DeGus Optimizes Adult SEO Partners

Alejandro Freixes ·
opinion

Moving the Needle to Lead Growth

Mitch Platt ·
opinion

Trying to Stop Web Fraud Before It Happens

Jonathan Corona ·
opinion

Webmasters Shouldn’t Wait for Disaster to Hit

Cathy Beardsley ·
opinion

Hefner’s Legacy Lives On in the Industry

Juicy Jay ·
opinion

Privacy Notices Shouldn’t Be Treated as an Afterthought

Corey D. Silverstein ·
opinion

Legal Issues Pop Up When Filming Sex in Public

Lawrence G. Walters ·
trends

A Road Less Traveled: Accepting Alternative Payment Solutions

Stephen Yagielowicz ·
trends

Credit Card Processing Today: Decline or Dominance?

Stephen Yagielowicz ·
Show More