2013-06-27 46 views
1

要剪辑来自其他网站的图像,我使用了Bookmarklet。 我成功地显示图像和选择图像,但同时将其存储在我的网络服务器上,我得到了跨域错误。错误如下:从其他网站剪下图像并将其添加到我的网站

未捕获TypeError:Object function(selector,context){// The jQuery对象实际上只是在init构造“加强”返回新jQuery.fn.init(选择,背景,rootjQuery);}有没有方法“closePopupMenu”

在此先感谢

+0

而你的问题是? – 2013-06-27 07:38:19

+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); 
}); 
+0

非常感谢代码:) –

+0

不客气。 – maqjav

+0

我必须在bookmark.so中添加剪贴器,当用户访问任何网站时,如果他/她想要获取该特定页面的图像,那么他将点击该书签链接,所有图像将显示在弹出窗口中。 –

相关问题