Skip to content

Instantly share code, notes, and snippets.

@ondrek
Created April 13, 2014 16:58
Show Gist options
  • Save ondrek/10592492 to your computer and use it in GitHub Desktop.
Save ondrek/10592492 to your computer and use it in GitHub Desktop.
<!DOCTYPE html><html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.2/jquery.mobile-1.1.0-rc.2.min.js"></script>
<title>Tamex Taxi</title>
</head>
<body>
<div data-role="content" id="content">
<button id="mojbutton">run doit()</button>
</div>
</body>
<script type="text/javascript">
$("#mojbutton").on("click", function(){
var pridajtext = $('<button id="mojbutton">My Button</button>');
$("#content").append(pridajtext).trigger('create');
});
$.ajax({
url: 'http://api.randomuser.me/',
dataType: 'json',
success: function(data){
var nejakeDataZjsonu = data.results[0].user.email;
$("#content").append("<div>"+nejakeDataZjsonu+"</div>").trigger('create');
}
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment