Hi ive been reading for almost 1week about json.
$.getJSON( 'accounts.json', function(data ) {
$('#try1').append("<option value='0' name='idsel'>Select Outlet</option>");
console.log(data);
$.each(data, function (i, item) {
$('#try1').append("<option value='" + item.outlet_group_id + "'>" + item.outlet_group_name + " : " + item.outlet_group_code + "</option>");
});
});
i have this script that works fine, but when i load it on the url it doesnt appear the url is this http://nutri.de.imerchmedia.com/services/accounts
Also i have tried jsonp, i came up with this
$.ajax({
url: 'http://nutri.de.imerchmedia.com/services/accounts',
dataType: 'jsonp',
success: function(data1){
$.each(data, function (k,v) {
console.log(data1);
$('#form').append(k + ':' + v);
});
}
});
i wonder is it me or it is the host?
any help would be much appreciated. also feel free to try extracting the data thru the link.
<script>element.