Upload pictures to the page specified location

// absolute positioning can give input, covering the event need to click the tab above

<input id="pice" type="file" multiple="" accept="image/*" capture="camera">

$("# pice ").change(function () {

// construct a document rendering Object

var reader = new FileReader();

// get an array of File List

fileObj = $(this)[0].files[0];

// get the file data

reader.readAsDataURL(fileObj);

reader.onload = function() {

// get file information

   imgData = reader.result;

// Specify location display pictures

$(".photo-box-img img").attr("src", imgData);

};

// then upload ajax

});

Guess you like

Origin www.cnblogs.com/zjboke/p/12149836.html