locked
WinJS.xhr always go to error function in some machine.

    Question

  • I am working with my team on a project that use local xml file as data storage and we use WinJS.xhr to load the file

    It works fine in my team member's machine but when I try to run it on my computer, it always goes to xhr error function.

    I tried to step-into the xhr function and I found this strange.

    In the req.onreadystatechange function in base.js(2317)
    when req.readystate value equal to 4 (base.js:2320)
    but the req.status value is 0
    So it goes to the line e(req) (base.js:2324) everytime.Thank you.

    As far as I know, The HTTP response code is between 1xx to 5xx so the 0 is impossible.

    Are there anyone got this issue? Is there any workaround for this?


    • Changed type Thiwakorn Tuesday, August 28, 2012 9:32 AM It seems to be a question
    Tuesday, August 28, 2012 9:26 AM

Answers

  • Can you post some sample code that will reproduce the problem?  There is no way to guess what is going on.

    -Jeff


    Jeff Sanders (MSFT)

    • Marked as answer by Thiwakorn Tuesday, August 28, 2012 12:56 PM
    Tuesday, August 28, 2012 12:12 PM
    Moderator
  • Thank you very much.

    I just have to put "ms-appx:///" prefix to the file url and it works.
    But I don't know why this works with other machine in my team.

    But however, thank you for your reply.


    Thiwakorn Faengrit Associate Technical Evangelist, DPE Microsoft (Thailand)

    • Marked as answer by Thiwakorn Tuesday, August 28, 2012 12:56 PM
    Tuesday, August 28, 2012 12:56 PM

All replies

  • Can you post some sample code that will reproduce the problem?  There is no way to guess what is going on.

    -Jeff


    Jeff Sanders (MSFT)

    • Marked as answer by Thiwakorn Tuesday, August 28, 2012 12:56 PM
    Tuesday, August 28, 2012 12:12 PM
    Moderator
  • Thank you very much.

    I just have to put "ms-appx:///" prefix to the file url and it works.
    But I don't know why this works with other machine in my team.

    But however, thank you for your reply.


    Thiwakorn Faengrit Associate Technical Evangelist, DPE Microsoft (Thailand)

    • Marked as answer by Thiwakorn Tuesday, August 28, 2012 12:56 PM
    Tuesday, August 28, 2012 12:56 PM