weixin_33708432 2016-08-27 18:52 采纳率: 0%
浏览 37

在ajax中使用绝对链接

I try to use absolute link but I can not get the file absolute link.

<!-- script src="jquery.min.js"></script -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>

//-----------
// var fileurl = "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"; 

it work when I used this link https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js for absolute link, but it not work when I use my link.

 var fileurl = "http://mintnet.net/cas242/abc/images/brown-Rice.jpg";


var listname = [];   

 $.ajax({
    url : fileurl, 
    success: function (data) {
          alert("the file is found");
     //  callback(data);
    },
     error: function () {  
          alert("the file doesn't exist");

    }
});

</script>

I alert out if get file success or not.

  • 写回答

0条回答 默认 最新

    报告相同问题?