Skip to Content
avatar image
-1
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 02, 2017 at 12:05 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2017 at 12:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded