Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cross domain AJAX requests with Access-Control-Allow-Origin

    Hi,

    with new browsers it's possibile to mitigate the cross domain ajax request problem using another trick, if you have access to the server side that fulfills the request: setting the header "Access-Control-Allow-Origin" in the response, like this in python (for example):

    Code:
    response.headers['Access-Control-Allow-Origin']='*'
    Anyway Smartclient LGPL 8.0 still presents the warning related to the same-origin policy, even if it will consume properly the data coming back from the server.

    Is there a way to disable that annoying warning?

    #2
    Nightlies now tell you about a flag you can set to disable the warning if you're happy with limited browser support.

    Comment


      #3
      thank you, looking forward to know this flag

      Anyway, I have tried with scriptInclude transport, but I cannot use POST requests with it

      Comment


        #4
        Using SmartClient Version: SNAPSHOT_v9.1d_2013-10-10/LGPL Development Only (built 2013-10-10)

        I know this is an old post but setting
        RPCManager.allowCrossDomainCalls = true works for me. This disables the warning and as long as the server allows cors via above method it should work. You should get your OPTIONS response then the real data request should fire. If you need to send custom headers make sure you allow this on the server as this will affect your PreFight ie (OPTIONS) response, and if not set correct then your real request will not fire.

        Hope this helps,

        Dan

        Comment

        Working...
        X