I'm trying to submit a .tsv file and then using d3.js to convert the .tsv file. (That later on will be used to plot a graph)
The d3.js is returning 404 file not found, is it the submit that is not working, or am I not calling the d3.tsv method correctly. Feels like its trying to execute the d3 part before I select the file
Edit: Added .submit for the #file-input
$('#fileSubmit').on('click', function() {
$('#file-input').trigger('click');
$('#file-input').on('change', function(){
$('#file-input').submit()(function{
alert("Submited!");
d3.tsv($('#file-input.'), function(data){console.log(data);})
});
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<button id="fileSubmit">Open</button>
<input id="file-input" type="file" name="name" style="display: none;" />
</body>