cancel
Showing results for 
Search instead for 
Did you mean: 

How can I avoid this error? - Access-Control-Allow-Origin

Former Member
0 Kudos

I want to access xsjs from an html5 application, but an error occurs.

スクリーンショット-2017-12-02-13716.png

How can I avoid this error?


other

html5 application logic.

スクリーンショット-2017-12-02-15435.png

xs application .xsaccess file.

スクリーンショット-2017-12-02-14725.png

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185511
Active Participant

if you are using mac OS,

1) Close google chrome and make sure it is totally closed there should not be any light on the chrome icon (you can right click and exit)

2) Open terminal and write the below code;

open -a Google\ Chrome --args --disable-web-security --user-data-dir

Open your URL again and try.

edit : someone gave negative vote for my comment but ,

Dear Mr. Smart whoever gave this vote, above error is not HANA specific. Any XMLHttpRequest done by JS to a different domain that your page will give this error. Browser blocks for security reasons. Chrome solution is above, Safari is much more easier you can disable CORS by default. Windows solution won't be different.

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ryuji,

If you use a destination in your html5 app, I think Web Dispatcher handles it.

With direct call, take a look at some search result.

CORS (cross origin resource sharing) Issue Resolved

Regards,

Masa