0

My code in Jquery is:

var accessUrl = 'testurl';
         var accessApplication = 'testapplication';


$.ajax({
             type: "POST",
             url: 'http://www.serveripaddress.com/Service.asmx/InsertAnalytics',
             //                    data: "{ 'URL': + $(this).context +','+'ApplicationName='+ $(this).context.innerHTML }",
             data: "{URL:'" + accessUrl + "', ApplicationName:'" + accessApplication + "'}",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             async: true,
             success: function(data) {
                 //debugger;
                 alert('success.');
             },
             error: function() {
                 // // debugger;
                 alert('Failed');
             }
         });
Java_User
  • 1,303
  • 3
  • 27
  • 38
  • 1
    You need jsonp http://stackoverflow.com/questions/2681466/jsonp-with-jquery –  Feb 19 '14 at 09:06
  • 1
    Are you trying to ajax across domains? If so, you'll have issues. You might read about Cross-Site Scripting (XSS) or look into JSONP or CORS. – mr rogers Feb 19 '14 at 09:11

0 Answers0