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
var DateRangePicker = function() { | |
this.init(); | |
} | |
DateRangePicker.prototype = { | |
init: function() { | |
var today = new Date(); | |
this.end_date = new Date(today.setDate(today.getDate() - 1)); | |
this.start_date = new Date(today.setDate(today.getDate() - 7)); | |
this.setDatePickerDefaults(); |
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
<input id="avatar" type="file" name="avatar" /> | |
<button id="upload" value="Upload" /> |
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
<!-- Change the target of the form to the hidden iframe --> | |
<form id="avatar_form" action="/welcome/upload" method="post" enctype="multipart/form-data" target="uploader_iframe"> | |
<input id="avatar" type="file" name="avatar" size="30" /> | |
</form> | |
<!-- Hidden iframe which will interact with the server, do not forget to give both name and id values same --> | |
<iframe id="uploader_iframe" name="uploader_iframe" style="display: none;"></iframe> | |
<!-- Just added to show the preview when the image is uploaded. --> | |
<img id="preview" src="preview.png" /> |