Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>IE innerHTML is very annoying indeed. I wrote this function for it, which may be helpfull? It quotes attributes and sets tagnames to lowercase. By the way, to make it even more annoying, IE's innerHTML doesn't remove quotes from non standard attributes.</p> <p><strong>Edit based on comments</strong> The function now processes more characters in attribute values and optionally converts attribute values to lower case. The function looks even more ugly now ;~). If you want to add or remove characters to the equation, edit the <code>[a-zA-Z\.\:\[\]_\(\)\&amp;\$\%#\@\!0-9]+[?\s+|?&gt;]</code> part of the regular expressions.</p> <pre><code>function ieInnerHTML(obj, convertToLowerCase) { var zz = obj.innerHTML ? String(obj.innerHTML) : obj ,z = zz.match(/(&lt;.+[^&gt;])/g); if (z) { for ( var i=0;i&lt;z.length;(i=i+1) ){ var y ,zSaved = z[i] ,attrRE = /\=[a-zA-Z\.\:\[\]_\(\)\&amp;\$\%#\@\!0-9\/]+[?\s+|?&gt;]/g ; z[i] = z[i] .replace(/([&lt;|&lt;\/].+?\w+).+[^&gt;]/, function(a){return a.toLowerCase(); }); y = z[i].match(attrRE); if (y){ var j = 0 ,len = y.length while(j&lt;len){ var replaceRE = /(\=)([a-zA-Z\.\:\[\]_\(\)\&amp;\$\%#\@\!0-9\/]+)?([\s+|?&gt;])/g ,replacer = function(){ var args = Array.prototype.slice.call(arguments); return '="'+(convertToLowerCase ? args[2].toLowerCase() : args[2])+'"'+args[3]; }; z[i] = z[i].replace(y[j],y[j].replace(replaceRE,replacer)); j+=1; } } zz = zz.replace(zSaved,z[i]); } } return zz; } </code></pre> <p>Example key-value pairs that should work</p> <pre><code>data-mydata=return[somevalue] =&gt; data-mydata="return[somevalue]" id=DEBUGGED:true =&gt; id="DEBUGGED:true" (or id="debugged:true" if you use the convertToLowerCase parameter) someAttribute=Any.Thing.Goes =&gt; someAttribute="Any.Thing.Goes" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload