想象一下,我想从以下位置获取图像:
http://www.entheosweb.com/fireworks/images/tracing/img18.jpg
使用 jquery ajax。
我该怎么做。
$.ajax({
url: 'http://www.entheosweb.com/fireworks/images/tracing/img18.jpg',
type: "POST",
dataType: "image",
async: true,
success: function(data) {
data = data.replace(/</g, '<');
data = data.replace(/>/g, '>');
$('#file_content').html('<pre>' + data + '</pre>');
},
error: function(a,b,c){
alert("There has been an error! Try again...");
}
});
我猜是这样的?