We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

in windows 7 and IE8,classic asp can not parse json ?RSS

7 replies

Last post Dec 15, 2020 03:36 AM by Brucz

  • in windows 7 and IE8,classic asp can not parse json ?

    Dec 05, 2020 01:23 PM|iisboy|LINK

    dim strJson,myJson
    
    strJson="{  ""access_token"":""ACCESS_TOKEN"",  ""expires_in"":7200,  ""refresh_token"":""REFRESH_TOKEN"",  ""openid"":""OPENID"",  ""scope"":""SCOPE"" }"
    set doc = CreateObject("htmlfile")
    doc.write "<meta http-equiv='X-UA-Compatible' content='IE=edge' />"
    set JSON = doc.frames.JSON
    set obj = JSON.parse(strJson)
    'myJson=JSON.stringify(obj)
    
    Response.Write obj.access_token
    
    

    i test in windows 7 ,and IE8,but have a little bug.

  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 07, 2020 05:32 AM|Brucz|LINK

    Hi iisboy,

    Could you descibe the bug detailed? Such as its status code, error message, reponse and request.

    Have you tested it in visual studio and have you tried to switch browsers or other versions of windows?

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 08, 2020 05:28 AM|iisboy|LINK

    when i test return message in below:

    Microsoft VBScript   Run-time Errors,erro: '800a01b6'

    Object doesn't support this property or method: 'doc'

    /test.asp,line 10

    browser:IE8.0

    OS:windows 7

    when i update IE8 to IE10+,then in IE10+,my code run very good.

  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 10, 2020 03:05 AM|iisboy|LINK

    Brucz

    Hi iisboy,

    Could you descibe the bug detailed? Such as its status code, error message, reponse and request.

    Have you tested it in visual studio and have you tried to switch browsers or other versions of windows?

    Best regards,

    Brucz

    Do u understand ,Brucz?

  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 14, 2020 09:35 AM|Brucz|LINK

    Hi iisboy,

    It took me long time to test it and find solution. Sorry for late reply.

    The error code is line 10:doc.write "<meta http-equiv='X-UA-Compatible' content='IE=edge' />", not set doc = CreateObject("htmlfile"). But when I tested it in visual studio, all work well.  I don't think it is a problem of code.

    You just need to change the identity of application pool to local system, it can work whether IE 8 or 10.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 14, 2020 03:22 PM|iisboy|LINK

    Brucz

    Hi iisboy,

    It took me long time to test it and find solution. Sorry for late reply.

    The error code is line 10:doc.write "<meta http-equiv='X-UA-Compatible' content='IE=edge' />", not set doc = CreateObject("htmlfile"). But when I tested it in visual studio, all work well.  I don't think it is a problem of code.

    You just need to change the identity of application pool to local system, it can work whether IE 8 or 10.

    Best regards,

    Brucz

    maybe i make a mistake screenshot. the error code in 11:"set JSON = doc.frames.JSON".

    if u not in win7,in 2012 server +, or win7 in IE10+,my little code run very well.i use your way to  change the identity of application pool to local system,Everything as before.So i guess my win 7 or IE8 not support the method "doc.frames.json",the code must run in IE10+.thanks again for you help me ,I thank you from the bottom of my heart.

  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 14, 2020 04:09 PM|iisboy|LINK

    I find some article later ,then i at last find a Real reason.

    Chrome 23, IE 10, and Safari 6 were the first browsers to fully support ECMAScript 5.

    Internet Explorer 9 does not support ECMAScript 5 "use strict".

    So,if u not use IE10,then the browser will not support ECMAScript 2009, also known as ES5.

    the same time ,JSON.parse() will not run in browser ,because JSON.parse() is a ES5 Features.

  • Re: in windows 7 and IE8,classic asp can not parse json ?

    Dec 15, 2020 03:36 AM|Brucz|LINK

    Hi iisboy,

    I tested it in win7 and IE 8, win7 and IE 10, all screenshots came from it.

    I am glad you can find the real reason.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.