Javascript Notes: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 10: Line 10:
   block.innerHTML=out
   block.innerHTML=out
}
}
</pre>
<pre>
    if ( console && console.log ) {
      console.log( "Sample of data:", data.slice( 0, 100 ) );
    }
</pre>
<pre>
        for ( var key in keys(data).sort) {
            elem.html = elem.html . key;
        }
</pre>
</pre>



Revision as of 01:08, 22 September 2013

function showattrs(theObject) {
   var out="<pre>"
   for (var attr in theObject) {
      out+=attr+":"+ theObject[attr]+"\n"
   }
   out+="</pre>"
 
   var block = document.getElementById("showattrs")
   block.innerHTML=out
}


    if ( console && console.log ) {
      console.log( "Sample of data:", data.slice( 0, 100 ) );
    }

        for ( var key in keys(data).sort) {
            elem.html = elem.html . key;
        }

Also see jquery notes