Skip to content

Instantly share code, notes, and snippets.

@pd
Created October 13, 2008 14:41
Show Gist options
  • Save pd/16540 to your computer and use it in GitHub Desktop.
Save pd/16540 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hi</title>
</head>
<body>
<ul>
<li>one</li>
<li>two</li>
<li style="display:none">hidden</li>
</ul>
</body>
</html>
// is run from cli like:
// -- % java -jar rhino/js.jar foo.js
// a -> one
// b -> two
load('src/env.js');
window.location = 'foo.html';
window.onload = function() {
load('/Users/kyleh/oly-dev/admin/public/js/liboly/jquery.js');
load('/Users/kyleh/oly-dev/admin/public/js/liboly/jquery.ext.js');
var lis = $('ul > li:visible');
lis.cycle('a', 'b');
lis.each(function() {
print($(this).attr('class') + ' -> ' + $(this).text());
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment