gerritvankuipers / aspjson

Classic ASP JSON Class Reading/Writing
78 stars 40 forks source link

Help wanted #13

Open nicoxxxcox opened 3 years ago

nicoxxxcox commented 3 years ago

Hello, Thank you for this very helpfull library.

I have some problems to use it.

My ajax send :

$.ajax({
    url: 'data-delta.asp',
    type: 'POST',
    contentType: "application/json; charset=utf-8",
    data: JSON.stringify({
        "firstName": "John",
        "lastName": "Smith",
        "age": 25,
        "address": {
            "streetAddress": "21 2nd Street",
            "city": "New York",
            "state": "NY",
            "postalCode": "10021"
        },
        "phoneNumbers": [{
                "type": "home",
                "number": "212 555-1234"
            },
            {
                "type": "fax",
                "number": "646 555-4567"
            }
        ]
    }),
    dataType: "json",
    cache: false,
    async: false,

    success: function(response) {

    }
});

And the file is getting data :

<!--#include file="aspJSON1.19.asp" -->
<%

Set oJSON = New aspJSON

' 'Load JSON string
oJSON.loadJSON(Request.form())

' Get single value
Response.Write oJSON.data("firstName")
%>

I've this error : loadJSON Error erreur '800a0001' No data to load. aspJSON1.19.asp, ligne 25

Thank you

ThorvaldAagaard commented 2 years ago

I assume that Request.form() isn't returning a string