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

opinion

After a Long Summer, It Is Back to Work

Mitch Platt ·
opinion

The Adult Industry Can No Longer Be an Island

Eric Paul Leue ·
opinion

Is Stale Blog Content Hurting Your SEO?

Adrian DeGus ·
opinion

Digital Advertising Really Isn’t Advertising

Juicy Jay ·
opinion

Will Your Business Need a Data Protection Officer?

Chad Anderson ·
profile

WIA Profile: Maxine Lynn

Women In Adult ·
profile

Q&A: ExoClick CEO Benjamin Fonzé on Ad Network Conquest

Alejandro Freixes ·
opinion

It’s Time for FSC to Set the Terms of Debates

Eric Paul Leue ·
educational

A Legal Primer to Help Develop Explicit Brands Previously Off Limits

Lawrence G. Walters ·
opinion

Preventing Data Breaches Staves Off Big Legal Claims

Chad Anderson ·
Show More