Media popup opens but faling to insert the images . After selecting images it goes page not found instead of closing the popup and returning to tb_unload.
I found below code from the template which calls the tb_show to upload the multiple images and gets the count of the attached images.
$('.theme-interface-option .upload_button, .theme-tax-form-field .upload_button')
.live('click',function() {
formfield = $(this).attr('id');
media = 'image';
formID = post_id;
no_tabs = '&no_tabs=1';
tb_show ( tfuse_title, 'media-upload.php?post_id='+formID+'&type='+media+'&
amp;formfield='+formfield+'&tab='+tab+no_tabs+'&TB_iframe=1' );
$('#TB_window,#TB_overlay,#TB_HideSelect').one('unload',killTheUnloadEvent);
$($('#TB_window').find('iframe')).load(function(){
var _image_form = $(this).contents().find('#image-form');
_image_form.attr('action',_image_form.attr('action')+no_tabs);
var _gallery_form = $(this).contents().find('#gallery-form');
_gallery_form.attr('action',_gallery_form.attr('action')+no_tabs);
});
$("#TB_window").bind('tb_unload', function () {
var attachments =
$(this).find('iframe').contents().find('#attachments-count');
var _placeholder = button.closest('.upload_button_div');
});
});
I have checked the url path of the iframe src it is correct and opens in another window.
What is the error in the above code why it goes to page not found? and also when I check the console log it show the typenow not defined