Skip to content

Instantly share code, notes, and snippets.

@zlatkov
Last active February 8, 2021 13:53
Show Gist options
  • Save zlatkov/0beb9a3c5dcffc6555428fc29e832332 to your computer and use it in GitHub Desktop.
Save zlatkov/0beb9a3c5dcffc6555428fc29e832332 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$.get('htps://example.com/api/profile', function(data) {
$('#username').val(data.name);
$('#useremail').val(data.email);
});
</script>
</head>
<body>
<form method='post' action='htps://example.com/api/profile'>
<fieldset>
<legend>Your Profile:</legend>
<label for='username'> Name:</label>
<input name='username' id='username' type='text'> <br><br>
<label for='email' > Email:</label>
<input name='email' id='useremail' type='email'> <br><br>
<button type='submit'> Update </button>
</fieldset>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment