Can someone please help me clear my doubts?
Greetings Experts,
I have this script:
- <script type="text/javascript">
- function CallService() {
- //Creating an object to hold token form field
myToken = new Object();
myToken.Token = $("#token").val();
- //Creating an object to hold form fields
myData = new Object();
- // Creating variables to hold data from textboxes. First building associated details
myData.Address = $("#Address").val();
myData.CallerAcctNum = $("#CallerAcctNum").val();
myData.CallerAddress = $("#CallerAddress").val();
myData.CallerCellPhone = $("#CallerCellPhone").val();
- $.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();
}
});
return false;
}
</script>
There is a whole lot more code than this but I am trying to keep it simple.
When I run this code, I expect to have a setup similar to below:
- http://domain/users/Loc/Services.php?data={
"Address":"221+Wesley+Ave.",
"CallerAcctNum":"00000172",
"CallerAddress":"",
"CallerCellPhone":"918-719-4529",
"CallerCity":"",
"CallerComments":"Paul,+Ron,"
}&token=4gyt57-39ddp
Can someone please, please help me confirm that the code above is producing similar results?
When I inspect the results in firefox, it shows:
QueryString: token="4gyt57-39ddp"
Form data: then it shows the json object as form data but i don't understand it.
Thanks for your help