-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_pic.php
26 lines (25 loc) · 901 Bytes
/
upload_pic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
include('sgs.php');
$file = new sgs();
?>
<script type="text/javascript">
parent_document = (window.parent.document);
var xx =parent_document.getElementById('pic_path');
xx.innerHTML = '<?php echo $file->destination;?>';
var divDoms = parent_document.getElementsByTagName('div');
for(var i=0; i < divDoms.length;i++){
if(divDoms[i]){
var classString = (divDoms[i].getAttribute('class')||divDoms[i].getAttribute('className'));
}
if(classString && classString.indexOf('loading')>=0){
var loadingDom = divDoms[i];
}
}
loadingDom.setAttribute('class', 'loading hide');
loadingDom.setAttribute('className', 'loading hide');
var preview = parent_document.getElementById('pic_preview');
preview.setAttribute('class', 'preview');
preview.setAttribute('className', 'preview');
preview.setAttribute('src', '../<?php echo $file->destination;?>');
console.log(1);
</script>