Search This Blog

Thursday, 29 November 2012

jQuery Ajax Call Failing

This is a problem I've been having at work for the last week or so.

I am using Apache 2.2 on Windows 7. In my JavaScript I need to read the contents of a text file, so I make this call:

   var fileContent = '';

   jQuery.ajax({
      url: 'myfile.txt',
      dataType: 'text',
      success: function (data) {
         fileContent = data;
      },
   });

which worked fine for months. Then suddenly it began failing, though notably only with large files (> 200K).

The symptoms were one of these:

  1. the Ajax call would fail
  2. the Ajax call would hang
  3. the text that came back was either missing bits or subtly mixed up

In the first case, the browser console would show the message NETWORK_ERR: XMLHttpRequest Exception 101. In case 3 the Apache logs showed a message about No space left on device and Error reading chunk.

The solution was to uninstall a Windows 7 update, namely KB2750841.

I actually experienced this problem back in September, when the update to uninstall was KB2735855. Incredibly I managed to completely forget about that fix, and so had to painfully get to the solution again from scratch. It is my fervent hope that the next time I search for NETWORK_ERR: XMLHttpRequest Exception 101, Google will decide that one of my own blog articles should come top of the search results.

Sunday, 18 November 2012

Why You Want to Avoid Sainsbury's Gift Cards

We changed to BT Infinity Broadband last month. Compared to the last time we changed provider it went quite smoothly. I haven't yet seen the sort of top speeds they advertise, and occasionally the download rate drops to under 1 Meg, but by and large it's a big improvement.

Part of the deal for this package was £50 of Sainsbury's vouchers. After they hadn't turned up or even been mentioned by BT for a few days after installation, I decided to contact BT. Not an easy option: I eventually had to register a fault. They agreed that we were entitled to them, although I got the distinct impression that if I'd kept quiet that would have been the end of it. They promised to dispatch the vouchers within 21 to 60 days! Why not in the next post?

Several weeks later two £25 Sainsbury's gift cards arrive. Unlike other gift cards I've received, these needed to be registered online. Groan. So off I head to their site.

Now I find out that to register a card I first need an account, and to have an account I also need to have a nectar card ("click here to register one"). I will try to condense the next twenty minutes of frustration and aggravation; suffice to to say that Sainsbury's now have my date of birth, memorable date and memorable place. (For anyone else trying this procedure, when they mention the 'Proceed' button, they mean the 'Submit' button.)

Finally I can get in to register the two cards. Why did I need an account? Well, now I can go online whenever I want to check the balance in these cards. We've just got back from Sainsbury's having spent the £50 in rather less time than it took me to register. The balance on the cards is now zero, and as I left the cards at the checkout, that's what it will remain until the end of time. Not coincidentally, the end of time is roughly when I will next try using Sainsbury's online facilities.

Friday, 16 November 2012

Anxiety Dreams and Sitting Exams

Dreaming you're back in school and suddenly realising that exams are coming up but you haven't done any revision and can't even remember the last time you went to a lesson seem to be very widespread among my friends and acquaintances. Clearly this dream draws upon some common anxiety.

A question then: what form did this dream take before sitting exams was a normal part of a person's upbringing?

Wednesday, 7 November 2012

Safari on Android

At last O'Reilly have released a Safari Library app for Android. Trying to get into and around their web site in a mobile browser was often a frustrating experience; this app is a huge improvement, albeit a bit buggy.

I discovered its existence by accident while frustratedly browsing the Safari site in Dolphin. I normally have JavaScript turned off for safety, but because of the way O'Reilly serve up books in Safari, that meant I couldn't see any text. So I enabled it, started reading, then noticed the app mentioned, and promptly went off and installed it.

Later that day I went back into Dolphin for a general browse and I was shocked by how slow web sites had become. Then I remembered JavaScript was still enabled. That made all the difference. Whether the JavaScript was there to "improve" the user experience, or just to serve up annoying ads, the effect on browser speed was significant.

Saturday, 3 November 2012

Borrowing Books on a Kindle

I've just borrowed my first book on my Kindle.

This facility is only offered you if you're an Amazon Prime subscriber, which I've been since I read an overly optimistic article predicting that Amazon would soon give Kindles away to their Prime subscribers. In the US prime membership gives you several advantages; in the UK, until recently, it only gave you free next day delivery. As you can sign up your whole household for this, it's proved enough of a selling point to justify the £49 annual fee. It has also made me more impatient: I used to happily go for the free 'several day' delivery, but now I'm stupidly annoyed if any Amazon item isn't available for Prime next day delivery.

Very recently Amazon changed the rules so that Prime members could 'borrow' one book a month on their Kindle. A choice of 200,000 titles!

Sadly, when I investigated it seemed they were mostly by authors I'd never heard of. That makes sense: if you're fairly unknown you can try raising your profile by effectively giving a few titles away. However, I've got a back reading list several bookshelves long already, without adding some more authors to it.

Then today I went looking for a Kindle Single that I'd heard recommended. Imagine my delight when I noticed I could borrow it. (Thus saving me the princely sum of £1.96!)

And the tactic worked. An Unexpected Twist by Andy Borowitz is a little delight, hilarious and moving. It only took 15 minutes to read, and I've already paid for another one of his books, Who Moved My Soap?: The CEO's Guide to Surviving in Prison.

Now a month to kill while I find another book I want to borrow. 199,999 choices left.