script type text javascript document ready function ajaxxx click funct

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<script type="text/javascript">
$(document).ready(function(){
$('#ajaxxx').click(function(){
$.getJSON('/blogs/ajax_up/', {type:'get_form'}, function(json){
$('#mainn').html('');
$('#mainn').append('<form id="upload_image" action="/blogs/ajax_up/" method="POST">')
.append(json.form)
.append('<input type="submit" value="Отправить фотку" class="button"/>')
.append('</form>');
});
});
});
</script>