Skip to content

Instantly share code, notes, and snippets.

@tucotuco
Created February 7, 2013 16:59
Show Gist options
  • Save tucotuco/4732393 to your computer and use it in GitHub Desktop.
Save tucotuco/4732393 to your computer and use it in GitHub Desktop.
First UI test from Tommy
<html>
<head>
<title>Geomancer Test Page</title>
<script src="http://www.desarrolloweb.com/articulos/ejemplos/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script>
function getFormat() {
var ua = $.browser;
if (ua.msie) {
return "&f=csv"
} else {
return "&f=verbose";
}
}
function getSearcData() {
return "q=" + $("#editbox").val();
}
function addHit() {
$.ajax({
type: "GET",
url: "http://beta.geomancer-api.appspot.com/api/georef",
data: getSearcData() + getFormat(),
success: function(msg) {
$("#destino").load(msg);
}
});
}
$(document).ready(function() {
$("#enlaceajax").click(function(evento) {
evento.preventDefault();
addHit();
});
})
</script>
</head>
<body>
<input id="editbox" size="80%" value="" type="text">
<a href="#" id="enlaceajax">Search</a>
<br>Result:<br>
<div id="destino"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment