i'm trying to get some data as json from cs-cart API so in the browser when i call some data like this
user name : admin@example.com
password : j58O9J11085SBycaDKMY1C75k1998rup
http://demos.cs-cart.com/54bbdcef36bac/api/payments
it get the requested data but when i try call this data from $.ajax nothing happening
first i create an HTML page
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id='#div1'></div>
<script type="text/javascript" src="./jquery-2.1.1.min.js" ></script>
<script type="text/javascript" src="./GetData.js" ></script>
</body>
</html>
and in the GetData.js
$(function(){
$.ajax({
type: 'GET',
url: 'http://admin%40example.com:j58O9J11085SBycaDKMY1C75k1998rup@demos.cs-cart.com/54bbdcef36bac/api/payments',
dataType: 'jsonp',
success:function(result){
console.log(result);
$("#div1").html(result);
}
});
});
and no data is retrieved and there is no errores to so what should i do to retrieve the data from the json file thank for any help in advance.
UPDATE:
it give this error whene add s to http so it give GET https://admin%40example.com:j58O9J11085SBycaDKMY1C75k1998rup@demos.cs-cart.…ayments?callback=jQuery211009486119472421706_1421614338422&_=1421614338423 net::ERR_CONNECTION_REFUSED
why jquery add parameter
?callback=jQuery211009486119472421706_1421614338422&_=1421614338423 net::ERR_CONNECTION_REFUSED
to the url
UPDATE
it now get the json but in the response as .js file and when i try to console.log the data nothing happening
$(function(){
$.ajax({
type: 'GET',
url: 'https://fadi40%example.com:j58O9J11085SBycaDKMY1C75k1998rup@demos.cs-cart.com/54bbdcef36bac/api/payments',
dataType: 'jsonp',
success:function(data){
console.log(data);
}
});
});