I am trying to find out how to change words in a sentence automatically. An example, is at Bookshout. They have the words at the end of the sentence change. I looked through their source code but couldn't find what was doing it.

1 answer

Saiyan 113

There is a javascript at the page that loads this page via Ajax.

This is the Code i've found inside the HTML-Code

<script type="text/javascript">
new PeriodicalExecuter(function() {new Ajax.Updater('random_topic', 'home/random_topic', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('48HsVjG22ZH4Ygpd2W/i3iGWp1hoqZaBOwTbmH2mRzQ=')})}, 6)

The Script is using the Ajax.Updater Object + the PeriodicalExecuter Object of the Prototype Framework.

Answered over 8 years ago by Saiyan