Created
February 7, 2013 16:59
-
-
Save tucotuco/4732393 to your computer and use it in GitHub Desktop.
First UI test from Tommy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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