Web Info & Tutorials

January 20th, 2008

CUEPROMPTER: JAVASCRIPT TELEPROMPTER

CuePrompter (via DownloadSquad) is an browser-based teleprompt tool. Cut-and-paste some or insert some text and the application will scroll it forward or back, at your desired speed. A variant of the Ajax e-reader concept.

Peeking at the source, it's been around since 2005. Implementation is small and straightforward. It works using a timer and manipulation of the top CSS property to continuously re-position the top of the entire text. (A negative top value means the top of the passage is "above" the browser window; hence you'll see text further along in the passage.)

JAVASCRIPT:
  1.  
  2. function fward() {
  3. ...
  4.   contentobj.top-=step
  5. ...
  6.   scrolltimerdown = setTimeout("fward()",scspeed)
  7. }
  8.  

January 20th, 2008

DANGERS OF REMOTE SCRIPTING

O'Reilly Radar comments on the dangers of remote scripting:

We at O'Reilly just got bit on perl.com, which redirected to a porn site courtesy a piece of remotely-included Javascript. One of our advertisers was using an ads system that required our pages to load Javascript from their site. It only took three things to turn perl.com into porn.com: (1) the advertiser's domain lapsed, (2) the porn company bought it, (3) they replaced the Javascript that we were loading with a small chunk that redirected to the porn site (note that nothing on or about perl.com changed). Our first concern was that we'd been hacked and "run this remote Javascript" inserted from our servers without our knowledge, but that hadn't happened—our change records and RT logs show we've had that Javascript and advertiser since May 2006.

There's nothing especially new about this; the external Javascript model has always been in place, long before Ajax and widgets. Yet, with widgets taking off, more and more users and developers are cutting-and-pasting script tags into their web pages, pulling in code from a wide variety of providers, big and small. How well equipped are publishers to decide which is safe and which is not, and deal with situations like O'Reilly experienced, where someone takes over an expired domain?