Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
EX: My site url "http://localhost:54887/CustomOrdering.html" but I want to get data from another site "http://localhost:27746/Orders.aspx". For this I wrote in CustomOrdering.html
JavaScript
function SessionLogin() {
                   $.ajax({
                       type: "GET",
                       dataType: "jsonp",
                       contentType: "application/json",
                       async: false,
                       url: 'http://localhost:27746/Orders.aspx/SessionLogin',
                       success: function (msg) {
                       },
                       error: function (jqXHR, textStatus, errorThrown) {
                           alert(errorThrown);
                       }
                   });
               }


in Order.aspx
C#
  public  void SessionLogin()
    {
        HttpContext.Current.Response.ContentType = "application/json";
        string qs = HttpContext.Current.Request.QueryString["callback"];
        HttpContext.Current.Response.Write(qs + "( [{ \"x\": 10, \"y\": 15}] )");
    }
}


Showing error " Jquery11110002214477863162756_1449484451326 was not called" . How can I get the result for the above html page from aspx page. Please suggest me it's urgent
Posted
Updated 10-Dec-15 18:47pm
v15
Comments
F-ES Sitecore 7-Dec-15 5:51am    
If it's urgent then google the problem and you'll get the answer right away. Google "jquery ajax cors" or "jquery ajax cors webemthod"
Nathan Minier 7-Dec-15 7:19am    
My go-to site for the various CORS configurations is http://enable-cors.org/
Member 10229339 11-Dec-15 0:47am    
Plz help me. I can't get any solution from last week

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900