Reputation: 47733
I don't understand how JS can run on the server. Meaning you get back an HttpWebResponse in one of your class wrappers and now you want to parse it. We know there are parser libraries out there such as Json.NET, ect. And all of them use some sort of JavaScriptSerializer method that they've coded. But I just don't get how IIS is going to invoke JS server-side for purposes such as this..parsing JSON.
I mean it's easy using jQuery. So basically could you take that jQuery code and somehow run it server-side to parse your JSON in a method in one of your concrete classes?
I just don't get this Javascript based serialization server-side when JavaScript runs in the browser and is client-side.
Upvotes: 1
Views: 199
Reputation: 77536
Most server-side implementations do not treat JSON as javascript. They treat it as a string that encodes an object graph using a specific syntax. In other words, it parses the javascript, but doesn't run it.
Upvotes: 1