I noticed something...instead of parsing a json object I think it is
trying to parse an xml doc....it is hitting the catch. I think I know
what the issue is. This project was designed to work on a servlet
engine and I'm running it via IIS 7....the web config needs to have
appropriate settings. Will reply back if this proves to be the case.

if ( status == "success" ) {
// Watch for, and catch, XML document parse errors
try {
        // process the data (runs the xml through httpData regardless of
callback)
        data = jQuery.httpData( xml, s.dataType );
} catch(e) {
                status = "parsererror";

On May 28, 5:14 pm, MorningZ <morni...@gmail.com> wrote:
> yuuuuuuuuccccckkkkk.... handcrafting JSON is a pain, thankfully
> there's great stuff out there by people who have thought of how to
> help, so some advice:
>
> grab this .NET component and drop it in your BIN directory:
>
> http://www.codeplex.com/json(note the new version only works
> with .NET 3.5, grab the older one if you're in 2.0)
>
> then you can stay thinking like .NET and objects
>
> Class for each item
>
>     Private Class Item
>
>         Private _value As String
>         Public Property value() As String
>             Get
>                 Return _value
>             End Get
>             Set(ByVal value As String)
>                 _value = value
>             End Set
>         End Property
>
>         Private _caption As String
>         Public Property caption() As String
>             Get
>                 Return _caption
>             End Get
>             Set(ByVal value As String)
>                 _caption = value
>             End Set
>         End Property
>
>         Public Sub New(ByVal i_value As String, ByVal i_caption As
> String)
>             Me.value = i_value
>             Me.caption = i_caption
>         End Sub
>
>     End Class
>
> Then to generate (and at the end the NewtonSoft object will take care
> of all JSON converstion that $.getJSON reads with no issues)
>
>         Dim Options As List(Of Item) = New List(Of Item)
>         If Not IsNothing(qs) Then
>             Options.Add(New Item("", "choose color"))
>             Select Case qs
>                 Case "7141832"
>                     sku = "7141832"
>                     Options.Add(New Item("bk", "Black Oil-tanned"))
>                     Options.Add(New Item("br", "Black Polishable"))
>                 Case "7173656"
>                     sku = "7173656"
>                     Options.Add(New Item("bk", "Black"))
>                     Options.Add(New Item("br", "Crazy Horse"))
>                 Case "7269643"
>                     sku = "7269643"
>                     Options.Add(New Item("bk", "Black"))
>                 Case Else
>                     Options.Add(New Item("bk", "Black"))
>             End Select
>
>             Response.Write
> (Newtonsoft.Json.JavaScriptConvert.SerializeObject(Options))
>
>         End If

Reply via email to