Created
November 16, 2016 19:39
-
-
Save NightZpy/05d82e9da12101db53e40aadb1a80f17 to your computer and use it in GitHub Desktop.
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
<!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