Tuesday, 15 January 2013
SharePoint 2013 - Unexpected response from server. The status code of response is '0'. The status text of response is ''.
I was receiving this error when attempting to use the Content Search WebPart in SharePoint 2013. After pulling plenty of hair out I opened the developer tools in internet explorer (F12) and started a network capture. This showed that it was trying to reach /_vti_bin/client.svc/ProcessQuery which was getting redirected to /_login which was getting redirected to /_windows and finally back to _/vti_bin/client.svc/ProcessQuery. This repeated several times before aborting.
I then tried to reach _vti_bin/Client.svc/lists in the browser which should have returned a list of lists from the web services, but it showed the same in the network capture.
It occurred to me that the web services (client.svc) probably didn’t think I was authenticated and so were maybe redirecting me to login. The login page presumably knew I was already logged in and was redirecting me back again.
In the end I was able to fix this by enabling Anonymous Authentication for the site in IIS Manager. I need to look into the implications of having anonymous authentication enabled, but at least it showed that the problem was due to security settings.
Sunday, 13 January 2013
HTML5 Storage
The HTML5 specification introduces some options for storing data on the client side. This can be either through session storage which retains the data while the browser is open or local storage which retains the data after the browser is closed.
It is worth noting that HTML5 storage data is stored unencrypted and is accessible to anything from the same domain. While I was able to play with HTML5 storage in Chrome using a local file, this didn't work with Internet Explorer 9 and it appears that it will only work with IE9 when being pulled from a web server.
You can check if HTML5 storage is supported by the client's browser with the following:
Simple data can be stored and retrieved in the following way:
Complex data types can be stored and retrieved by converting them to a string before storing using JSON.stringify() and then converting them back using JSON.parse():
I put together a quick demo using HTML5 local storage to create a phone book that supports adding, editing and deleting. It can be found here.
It is worth noting that HTML5 storage data is stored unencrypted and is accessible to anything from the same domain. While I was able to play with HTML5 storage in Chrome using a local file, this didn't work with Internet Explorer 9 and it appears that it will only work with IE9 when being pulled from a web server.
You can check if HTML5 storage is supported by the client's browser with the following:
Simple data can be stored and retrieved in the following way:
Complex data types can be stored and retrieved by converting them to a string before storing using JSON.stringify() and then converting them back using JSON.parse():
I put together a quick demo using HTML5 local storage to create a phone book that supports adding, editing and deleting. It can be found here.
Subscribe to:
Posts (Atom)