<script>
function upload(file) {
if(file.type.match(/image.*/)){
var fd = new FormData();
fd.append("image", file);
var xhr = new XMLHttpRequest();
$("#up_status").html("Đang tải lên...");
xhr.open("POST", "http://rhash.tk/upload.php?domain=hicode.wap.mu"); /* This color red is your domain */
xhr.onload = function() {
$("#up_status").html("Thêm ảnh");
$("#input_frm").val('');
var link = JSON.parse(xhr.responseText);
$('#select').val("[img]"+link['link']+"[/img]");
}
xhr.send(fd);
};
};
</script>
<a onclick="$('#input_frm').click()" id="up_status"><font color="#333">Thêm ảnh</a>
<input style="display:none" type="file" onchange="upload(this.files[0])" id="input_frm">
![[OFF]](/assets/images/off.gif)