剪辑其他网站的图像并将其添加到我的网站

时间:2013-06-27 07:32:16

标签: php javascript jquery html5

要剪辑我使用过Bookmarklet的其他网站的图片。 我在显示图像和选择图像方面取得了成功,但在将其存储在我的网络服务器上时,我收到了跨域错误。错误如下:

未捕获TypeError:对象函数(选择器,上下文){// jQuery对象实际上只是init构造函数'enhanced'返回新的jQuery.fn.init(selector,context,rootjQuery);}没有方法'closePopupMenu'

提前致谢

1 个答案:

答案 0 :(得分:0)

您可以使用以下内容:

// Obtain HTML from a website
$.get("http://www.google.com", function(data) {
    // Extract every img tag from the complete HTML
    $('img', data).each(function() {
        // Extract the src attribute from every IMG
        alert($(this).attr('src'));
    });
}).fail(function(xhr, textStatus, errorThrown) {   
    alert("error: "+textStatus); 
});