Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| var _URL = window.URL || window.webkitURL; | |
| $("#article_image").change(function(){ | |
| var file, img, reader; | |
| if ((file = this.files[0])) { | |
| img = new Image(); | |
| img.onload = function(){ | |
| if ( (this.width < 960) || (this.height < 300) ) { | |
| alert("Image must be larger than 960x300 pixels!") | |
| } else { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <h1>Sample#preview_image_file_browser</h1> | |
| <input id="one_image" name="one_image" type="file"> | |
| <div id="preview_container"></div> | |
| <script type="text/javascript"> | |
| var setPreviewImage = function(file){ | |
| var reader = new FileReader(), | |
| newImage = new Image(); |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |