试图删除正被送回imgUrl的完整URL: 通常返回类似http://localhost/wordpress/wp-content/uploads/filename.jpg 或http://localhost/wordpress/wp-content/uploads/images/filename.jpg删除完整路径,文件名保持只
我想去掉一切,除了filename.jpg和回报它到 ahng_photos_upload_image。将所有内容剥离到最后一个正斜杠处。 我怎么用JQuery来做到这一点?
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery('#ahng_photos_upload_image').val(imgurl);
tb_remove();
}
txt.substring(txt.lastIndexOf(“/”)+ 1) – 2012-02-19 21:22:33