Skip to content

Instantly share code, notes, and snippets.

@will
Created June 15, 2009 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will/130364 to your computer and use it in GitHub Desktop.
Save will/130364 to your computer and use it in GitHub Desktop.
#!/usr/bin/env jruby
require 'rubygems'
require 'celerity'
url = "http://uiuc.us/jquery.html"
puts "url should be #{url}"
[:firefox, :internet_explorer].each do |browser|
b = Celerity::Browser.new :log_level => :severe, :browser => browser
b.goto url
b.buttons.first.click
puts "#{browser} got: #{b.url}"
end
# output
# url should be http://uiuc.us/jquery.html
# firefox got: http://www.google.com/
# internet_explorer got: http://uiuc.us/jquery.html
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>jquery-bug</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function() {
$("form").submit(function(event){
event.preventDefault();
return false;
});
});
</script>
</head>
<body>
<form action="http://google.com">
<input type=submit id="submit" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment