954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

jquery/thickbox generated Wordpress media-upload box empty

I am working on a local server on adding a media uploadbox to a Wordpress plugin Datafeedr Randam adds for a few days now and the code I have come up with so far is here http://wordpress.pastebin.com/xF0xs9mL . Code added to load needed scripts starts at line 101 and media upload html is located on line 354.
I have Been trying to get help at several places and did get some at #wordpress IRC. By changing the location of the script loading code - moving it to the top - things improved. Right now thickbox works and the media-upload box is loaded. I am stuck again though. Thickbox loads an empty box now instead of the media-upload details so I can upload images. One custom external javascript that is loaded into the plugin besides the WP nativity used JQuery and Thickbox I will post here:

jQuery(document).ready(function() {

jQuery('#upload_image_button').click(function() {
 formfield = jQuery('#upload_image').attr('name');
 tb_show('','media-upload.php?type=image&TB_iframe=true');
 return false;
});

window.send_to_editor = function(html) {
 imgurl = jQuery('img',html).attr('src');
 jQuery('#upload_image').val(imgurl);
 tb_remove();
}

});


Can anybody see why I get an empty thickbox and how this can be remedied? The fact that I see a 404 in the logs:

::1 - - [21/May/2010:09:00:56 +0400] "GET /wordpress/wp-admin/&random=1274418056878 HTTP/1.1" 404 16383


means the wrong page is loaded, but why?

rhand
Newbie Poster
10 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

Well I have changed the path to my-script.js and now the upload box is loaded. Only it seems like I have an empty thickbox with the uploadbox underneath: http://wordpress.pastebin.com/ktmLtVji .

rhand
Newbie Poster
10 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

the &random=(number) is causing the problem.

gibigbig
Newbie Poster
1 post since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: