再一次如果您使用的是文件上载,则它与图像上载不同。要获取文件url,请使用:$(html)。属性(\'href\');
文件上载:
window.send_to_editor = function(html){
var file_url = $(html).attr(\'href\');
// Do something with those variables
tb_remove();
};
图像上载:
window.send_to_editor = function(html){
var file_url = $(\'img\', html).attr(\'src\'),
classes = $(\'img\', html).attr(\'class\'),
id = classes.replace(/(.*?)wp-image-/, \'\');
// Do something with those variables
tb_remove();
};