Archive for May 16th, 2010

Especially if you’re trying to match attributes and their values!
Thankfully Kooilnc, the godsend has a solution:
http://stackoverflow.com/questions/1231770/innerhtml-removes-attribute-quotes-in-internet-explorer
I’ve wrapped that up into a jQuery function here:
123456789101112131415161718192021222324$.fn.ieInnerHTML = function() {
  var zz = this.html(),
       z =
     zz.match(/<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|’.*?’|[^'">\s]+))?)+\s*|\s*)\/?>/g);
    if (z){
      for (var i=0;i<z.length;i++){
        var y, zSaved = z[i];
  [...]

God I hate IE…. and I really don’t often hate anything….
IE tends to cache its responses to some AJAX requests, which if you ask me is very stupid for its default behaviour.
FireFox caching is disabled by default. As always much love to the Fox.
Anyway, if you’re using jQuery.ajax() remember to pass the cache: false argument [...]


top