Could not add Access-Control-Allow-Origin to my WCF library Project

后端 未结 6 996
Happy的楠姐
Happy的楠姐 2021-02-09 08:53

I\'m trying to understand why this ajax called doesn\'t work

 $.ajax({
        type: \'GET\',
        url: \"http://localhost:8732/Design_Time_Addresses/InMotion         


        
6条回答
  •  一生所求
    2021-02-09 09:46

    This link would help: http://enable-cors.org/

    You need to add the following headers in your response that is sent back to the client:

    //Allow all domains

    Access-Control-Allow-Origin: *

    OR

    //Allow specific domains

    Access-Control-Allow-Origin: http://example.com:8080 http://foo.example.com

提交回复
热议问题