Skip to content

Instantly share code, notes, and snippets.

@NightZpy
Created November 16, 2016 19:39
Show Gist options
  • Save NightZpy/05d82e9da12101db53e40aadb1a80f17 to your computer and use it in GitHub Desktop.
Save NightZpy/05d82e9da12101db53e40aadb1a80f17 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Text to Image</title>
</head>
<body>
<textarea name="text" placeholder="Test here..."></textarea>
<label>Select Hex Color: </label>
<input type="text" placeholder="#000000" value="#000000" name="color">
<button id="send" type="button">Get Image</button>
<img src="" id="image" style="display: none">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready({
$("#send").click(function() {
$.ajax({
type: 'POST',
url: 'convert.php',
data: {
text: $("input[name='text']").val(),
color: $("input[name='color']").val()
},
success: function( response ){
$('#image').attr("src", response);
}
});
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment