Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

I am having a hard time getting the format of this code correct. PLease help?

$
0
0

I hope several of you super AJAX/jQuery geniuses can help me out here.

I have this code:

$.ajax({
    type: "POST",
    url: "proxyCheck.asp?token=" + myToken.Token,
    data: {
        data: JSON.stringify(myData)
    },
    dataType: "json",
    async: false,
    success: function (response) {
        alert("Record has been added successfully.");
        window.location.reload();
    }
});

First, myToken.Token gives you some string value like wteu-eirhe-14ry , just and example

Then myData is formatted as JSON data in the following format:

      data:{"Address":"254+Johnson+Ferry+Rd.,+NW","City":"Greek+Springs","District":"North","State":"IL","StreetName":"254+Johnson+Rd.,+NW","Zip":"30328","SiteContactDisplay":"Jane,+Curly,+","CallerAcctNum":"0000124655"
            }

So, when I run this code, I was expecting something like this:

mypage.asp?data:{"Address":"254+Johnson+Ferry+Rd.,+NW","City":"Greek+Springs","District":"North","State":"IL","StreetName":"254+Johnson+Rd.,+NW","Zip":"30328","SiteContactDisplay":"Jane,+Curly,+","CallerAcctNum":"000012YT55"
            }&token=wteu-eirhe-14ry

Please notice &token=wteu-eirhe-14ry

Can someone please tell me what I am doing wrong with the ajAX code above?

This has stumped me for 3 days.

Thanks alot in advance

 

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>