WinJS.xhr Issue while running next time

WinJS.xhr Issue while running next time

  • Comments 4

Windows 8 and WinJS.xhr goes hand in hand while developing application to consume web. I was trying out something like that. It used to work fine for the first run. But the second and consecutive runs it gives error as below.

clip_image002

Error message

Exception is about to be caught by JavaScript library code at line 2351, column 21 in ms-appx://microsoft.winjs.1.0/js/base.js

0x800c0008 - JavaScript runtime error: The download of the specified resource has failed.

If there is a handler for this exception, the program may be safely continued.

I had to delete the bin\debug to run it. This is not possible in installed application and this error was causing my application failure.

I got an elegant solution to get rid of this issue. Somehow it was caching the page and due to which I was getting error at base.js file which I cannot edit.

So I have added the code to disable the cache

return WinJS.xhr({
            url: url1,
            headers: { "Cache-Control": "no-cache", "If-Modified-Since": "Mon, 27 Mar 1972 00:00:00 GMT" }
        });

Namoskar!!!

Leave a Comment
  • Please add 3 and 3 and type the answer here:
  • Post
  • Worked like a charm. Appreciate.

  • Where do I add this code in the app? What file?

  • @S-Dev,

    Love to hear that

  • @vdsd, Anywhere, the place from where you call WinJS.xhr

Page 1 of 1 (4 items)