on 02-27-2018 5:41 AM
I am following the Tiny world Tutorial had issue on this part of the tutorial : https://blogs.sap.com/2016/03/29/developing-with-xs-advanced-application-life-cycle/
I am having a problem adding the country.The response is always: {“readyState”:0,”status”:0,”statusText”:”error”}
and in the console I get this message:
” Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. ”
Also can you specifiy what url to use in the ajax url ?
Hi Roshan,
The URL should be this:
url:"country/country.xsjs",
Here is the full ajax post request:
$.ajax({
type: "POST",
url: "country/country.xsjs",
contentType: "application/json", data: insertdata, dataType: "json", crossDomain: true, success: function(data) {
oFirstDialog.close();
sap.ui.getCore().byId("tinytab").getModel().refresh(true);
alert("Data inserted successfully");
},
error: function(data) {
var message = JSON.stringify(data);
alert(message);
}
});
Make sure you also make the needed changes to the country.xsjs code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.