how to get jquery.couch.app.js to work with IE8

Posted by fuzzy lollipop on Stack Overflow See other posts from Stack Overflow or by fuzzy lollipop
Published on 2010-04-28T03:47:46Z Indexed on 2010/04/28 3:53 UTC
Read the original article Hit count: 276

Filed under:
|
|

I have tested this on Windows XP SP3 and Windows 7 Ultimate in IE7 and IE8 (in all compatiblity modes) and it fails the same way on both. I am running the latest HEAD from the the couchapp repository. This works fine on my OSX 10.6.3 development machine. I have tested with Chrome 4.1.249.1064 (45376) and Firefox 3.6 and they both work fine. As do the Safari 4 and Firefox 3.6 on OSX 10.6.3

Here is the error message

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) Timestamp: Wed, 28 Apr 2010 03:32:55 UTC

Message: Object doesn't support this property or method Line: 159 Char: 7 Code: 0 URI: http://192.168.0.105:5984/test/_design/test/vendor/couchapp/jquery.couch.app.js

and here is the "offending" bit of code, which works on Chrome, Firefox and Safari just fine. If says the failure is on the like that qs.forEach() from the file jquery.couch.app.js

  157 var qs = document.location.search.replace(/^\?/,'').split('&');
  158 var q = {};
  159 qs.forEach(function(param) {
  160   var ps = param.split('=');
  161   var k = decodeURIComponent(ps[0]);
  162   var v = decodeURIComponent(ps[1]);
  163    if (["startkey", "endkey", "key"].indexOf(k) != -1) {
  164     q[k] = JSON.parse(v);
  165   } else {
  166    q[k] = v;
  167   }
  168 });

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about couchapp