Skip to content

Instantly share code, notes, and snippets.

@sudosoul
Created June 6, 2019 05:00
Show Gist options
  • Save sudosoul/4c22aa1023cf1eaba68ec8969d533288 to your computer and use it in GitHub Desktop.
Save sudosoul/4c22aa1023cf1eaba68ec8969d533288 to your computer and use it in GitHub Desktop.
softgrid-example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MY APP</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<!-- PHOTO-->
<form class="imageUploadForm" action="https://demo.api.vedagraceclinic.com/upload" enctype="multipart/form-data" method="POST">
<input type="file" name="image" accept="image/*" capture/>
<input type="submit" value="Upload Photo"/>
</form>
<script>
$(document).on('submit', '.imageUploadForm', function(){
// Show the loading screen
$.ajax({
type: 'post',
url: 'https://demo.api.vedagraceclinic.com/upload',
enctype: 'multipart/form-data',
processData: false,
contentType: false,
data: new FormData(this) ,
success: function(data) {
//alert(data);
// parse the data, and inject into the final screen
// once final screen ready, display it
}
});
return false;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment