ITsolutionWizard
asked on
asp.net cross domain in Chrome
I have below codes with cross domain issue in Chrome and Firefox.
And I did install below links from Chrome but still not working.
However, IE working with enable the cross domain under Internet Option >> Security Tab
Any ideas
function GetModelList(divisCode)
var customerNo = "315217";
var GetModelListJSon = "http://clientaccesstest.abc/GetModel";
$(document).ready(function () {
$.ajax({
cache: false,
type: "GET",
async: false,
dataType: "json",
contentType: 'text/plain',
url: GetModelListJSon + encodeURIComponent("(011,1 15217)"),
success: function (data) {
$('#data').html(data);
if (data == null)
return;
resultObj = jQuery.parseJSON(data);
if (resultObj.Status != 'Failed') {
$('#json').html(setModelIn fo(resultO bj.Data,di visCode));
}
},
error: function (xhr,status,error) {
$('#data').html(xhr.respon seText);
alert(xhr.responseText + " : error GetModelListJSon");
alert(status);
alert(error);
}
});
});
}
https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
https://chrome.google.com/webstore/detail/forcecors/oajaiobpeddomajelicdlnkeegnepbin/related?hl=en
http://codedevstuff.blogspot.com/2014/10/use-chrome-for-development-and-allow.html
And I did install below links from Chrome but still not working.
However, IE working with enable the cross domain under Internet Option >> Security Tab
Any ideas
function GetModelList(divisCode)
var customerNo = "315217";
var GetModelListJSon = "http://clientaccesstest.abc/GetModel";
$(document).ready(function
$.ajax({
cache: false,
type: "GET",
async: false,
dataType: "json",
contentType: 'text/plain',
url: GetModelListJSon + encodeURIComponent("(011,1
success: function (data) {
$('#data').html(data);
if (data == null)
return;
resultObj = jQuery.parseJSON(data);
if (resultObj.Status != 'Failed') {
$('#json').html(setModelIn
}
},
error: function (xhr,status,error) {
$('#data').html(xhr.respon
alert(xhr.responseText + " : error GetModelListJSon");
alert(status);
alert(error);
}
});
});
}
https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
https://chrome.google.com/webstore/detail/forcecors/oajaiobpeddomajelicdlnkeegnepbin/related?hl=en
http://codedevstuff.blogspot.com/2014/10/use-chrome-for-development-and-allow.html
ASKER
add dataType: : "jsonp" - The error still occurs.
Thank you for your time to help ....
Thank you for your time to help ....
please try this
function GetModelList(divisCode)
var customerNo = "315217";
var GetModelListJSon = "http://clientaccesstest.abc/GetModel";
$(document).ready(function () {
$.ajax({
crossDomain: true,
cache: false,
type: "GET",
async: false,
dataType: "json",
contentType: 'text/plain',
url: GetModelListJSon + encodeURIComponent("(011,1 15217)"),
success: function (data) {
$('#data').html(data);
if (data == null)
return;
resultObj = jQuery.parseJSON(data);
if (resultObj.Status != 'Failed') {
$('#json').html(setModelIn fo(resultO bj.Data,di visCode));
}
},
error: function (xhr,status,error) {
$('#data').html(xhr.respon seText);
alert(xhr.responseText + " : error GetModelListJSon");
alert(status);
alert(error);
}
});
});
}
function GetModelList(divisCode)
var customerNo = "315217";
var GetModelListJSon = "http://clientaccesstest.abc/GetModel";
$(document).ready(function
$.ajax({
crossDomain: true,
cache: false,
type: "GET",
async: false,
dataType: "json",
contentType: 'text/plain',
url: GetModelListJSon + encodeURIComponent("(011,1
success: function (data) {
$('#data').html(data);
if (data == null)
return;
resultObj = jQuery.parseJSON(data);
if (resultObj.Status != 'Failed') {
$('#json').html(setModelIn
}
},
error: function (xhr,status,error) {
$('#data').html(xhr.respon
alert(xhr.responseText + " : error GetModelListJSon");
alert(status);
alert(error);
}
});
});
}
ASKER
add crossDomain: true, the problem still does not resolve....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dataType: "jsonp" in place of dataType: "json" and try