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: Ruth Blair

Women In Adult ·
profile

New Kids on the Block: FuckingAwesome.com

Rhett Pardon ·
trends

Mandatory Age Verification: A Game Changer for Adult

Stephen Yagielowicz ·
trends

The European Legal Scene: Challenges, Opportunities in 2017

Stephen Yagielowicz ·
trends

Euro Trends: Evolving a Unique Marketplace

Stephen Yagielowicz ·
profile

Q&A: Yanks.com Flourishes With Commander Todd Spaits

Alejandro Freixes ·
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 ·
Show More