picture_in_upload_fo rm createAppend div id preview_with_delete classN

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$('#picture_in_upload_form').createAppend(
'div', { id: 'preview_with_delete'}, [
'a', { className: 'thickbox', href: result.big }, [
'img', { src: result.medium },
],
'form', {method: 'post', action: ''}, [
'input', {type: 'hidden', name: 'picture_id', value: result.picture_id}, [],
'input', {type: 'submit', className: 'buton', name: 'picture_delete', value: 'delete'}
]
]
);
//////////////////////////////////////////////////
str = "<div id='preview_with_delete'>";
str += "<a class='thickbox' href='"+result.big+"'><img src='"+result.medium+"'/></a>";
str += "<form method='post' action='.'>";
str += "<input type='hidden' name='picture_id' value='"+result.picture_id+"'/>";
str += "<input type='submit' class='button' name='picture_delete' value='Удалить'/>";
str += "</form>";
str += "</div>";
$("#picture_in_upload_form").append(str);