-
Notifications
You must be signed in to change notification settings - Fork 44
Home
genetify.js
===
Loaded in a webpage, genetify.js lets you create experiments in your code.
Each experiment tests a group of alternatives and chooses the best one.
Genetify.js works with groups of CSS rules, javascript variables and HTML
tags. The groups are defined implicitly by adding special suffixes like “_vBeta”
to an object’s original name.
Experiments are evaluated by user feedback. Any kind of user interaction can
be turned into a goal of an experiment by using standard DOM events.
The aim of genetify.js was to make the programming of code experiments as
natural as possible.
Terminology
-————
Groups of CSS rules, javascript variables or HTML tags whose members are meant
to be tested on users will be called genes, inspired by the unit of
selection in biological evolution.
The members of those groups will be called variants because they should each
vary one from the other in some purposeful way.
To say that something is genetified is to say that it has been branched off
into multiple variants and is ready to be tested.
Installation
-————-
Insert a style tag into the head of a HTML document.
<style type="text/css" media="screen"> .v { display: none; } .genetify_disabled { display: none !important; } .genetify_enabled { display: block !important; } </style>
These CSS rules are important because they ensure that variants are not
displayed if genetify.js fails to load or execute.
Below the style tag, insert a script tag referencing genetify.js.
<script type="text/javascript" src="genetify.js"></script>
Genetify.js must be loaded before any other javascript upon which it is
supposed to act, so typically it should be inserted as the first script tag in
the head. As a small optimization, you could put it below any scripts you know
will not be genetified.
At the bottom of the page, just before the