Theiling Online    Sitemap    Conlang Mailing List HQ   

OT: JavaScript (Was Re: Sheli Names)

From:Aaron Grahn <aaron@...>
Date:Sunday, December 4, 2005, 20:21
You could do such a thing with a client-side script, but the nature of
client side programming means that it could not reasonably be guaranteed
to work on all platforms. My preference would be for a Perl CGI (or
whatever your favorite server-side language might be) since that can be
guaranteed to work with every HTTP client.

<script type="text/javascript">
function nameGen ()
    var a = new Array ("piston", "crankshaft", "helicopter", "engine",
"pulley", "rail");
    var b = new Array ("bark", "leaf", "sap", "root", "twig", "branch",
"mistletoe", "bud");
    var c = new Array ("athens", "corinth", "sparta", "argos", "thebes",
"corcyra", "byzantium", "megara");
    var name = a [Math.floor (Math.random () * a.length)] + " " + b
[Math.floor (Math.random () * b.length)] + " " + c [Math.floor
(Math.random () * c.length)];
    return name;
<form action="#" onsubmit="return false;">
<input type="text" name="name"/>
<input type="button" value="Klicken Sie hier, bitte"
onclick="this.form.elements ("name").value = nameGen ();"/>

would probably work on most clients. Though I haven't tested it on any.

Since the names we use are so varied in origin, it is not really
feasible to translate one into another language. For instance, "Aaron"
has a Hebrew origin, whereas "Lloyd" is Celtic, and "Richard" is
Germanic. Only if we used names like "Piston son of Flywheel" (with a
consistent naming language) could such a translation be readily achieved.


David J. Peterson wrote:

> My purpose in writing is twofold. First, I wanted to announce > a new names page for Sheli (I find names fun): > > > > Second, I wanted to see if I could get some JavaScript advice. On > this names page I want to have one of two things: Either a button > you can press that'll randomly generate a name of Sheli (it'd require > grabbing one word from each of three lists and listing them), or > a field where you can enter your name and get the Sheli equivalent. > For the latter, I'd want to have some way of manipulating the > selection criteria (e.g., if a name begins with a certain letter and > has a certain number of letters in it, then it'll return a given name). > I gather the former would be easier. Anyway, I'd be appreciative > of any advice (especially if someone knows of a script like this > out there somewhere on the web...). > > -David > ******************************************************************* > "sunly eleSkarez ygralleryf ydZZixelje je ox2mejze." > "No eternal reward will forgive us now for wasting the dawn." > > -Jim Morrison > > > > >