Skip to content

Instantly share code, notes, and snippets.

Avatar
📘
Learning

AmitKKhanchandani

📘
Learning
View GitHub Profile
@AmitKKhanchandani
AmitKKhanchandani / formdata-example.js
Created Oct 18, 2018
FormData Example with File from the input element
View formdata-example.js
var file = $('#order_file').prop('files')[0];
var form_data = new FormData();
form_data.append('order_file',file)
$.each($('#ordercreate').serializeArray(), function (key, input) {
if (form_data.has(input.name)) {
form_data.set(input.name, input.value);
} else {
form_data.append(input.name, input.value);
}
});
@AmitKKhanchandani
AmitKKhanchandani / index.html
Created May 26, 2018
JS Bin redux counter example // source https://jsbin.com/gugexik
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="redux counter example">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>