Membuat Pesan Tampil Di Console Log Untuk Blogger

Membuat Pesan Tampil Di Console Log Untuk Blogger
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Console Log


Console Log Adlah alat untuk memberitahukan kesalahan pada HTML inspect element, nah penggunaan yang tidak tepat lah akan menyebabkan account atau website dapat di curi atau di sebut scam atau hacking.
namun tidak menutup kemungkinan sahabat blogger menggunakan tools developer hanya untuk sekedar mengecek apa ada kesalahan pada beberapa link atau kode di website sobat.
nah untuk mempercantik console log window di chrome atau mozzila silahkan ikuti tutorial berikut.

Cara nya sangat mudah hanya tambahkan kode JS di atas kode </body> gunakan CTRL + F
Spoiler
<script>
//<![CDATA[
function printLogEntries (logEntries) {
  function padLeft(nr, n, str) {
    return Array(n-String(nr).length+1).join(str||'0')+nr;
  }

  var DDLogFlagError = (1 << 0),
      DDLogFlagWarning = (1 << 1),
      DDLogFlagInfo = (1 << 2),
      DDLogFlagDebug = (1 << 3),
      DDLogFlagVerbose = (1 << 4);

  var COLORS = [];
  COLORS[DDLogFlagError] = 'background:black;color:red';
  COLORS[DDLogFlagWarning] = 'background:black;color:yellow';
  COLORS[DDLogFlagInfo] = 'background:white;color:black';
  COLORS[DDLogFlagDebug] = 'background:white;color:pink';
  COLORS[DDLogFlagVerbose] = 'background:white;color:gold';

  var logLines = [], logLinesColor = [];
  [].forEach.call(logEntries, function(logEntry) {
      var d = new Date(logEntry.timestamp);
      var dateFormatted = [
        [d.getFullYear(), padLeft(d.getMonth()+1,2), padLeft(d.getDate(),2)].join('/'),
        [padLeft(d.getHours(),2), padLeft(d.getMinutes(),2), padLeft(d.getSeconds(),2)].join(':')
        ].join(' ');
      var logStr = ([
        '%c [' + dateFormatted + ']',
        '%c ' + logEntry.message
      ].join(' '));
      logLines.push(logStr);
      logLinesColor.push('background:white;color:black');
      logLinesColor.push(COLORS[logEntry.level]);
  });
  console.log.apply(console, [logLines.join('\n')].concat(logLinesColor));
}

printLogEntries([
  {level: 1, message: 'Error Log', timestamp:1467638116285},
  {level: 2, message: 'Warning Log', timestamp:1467638118285},
  {level: 4, message: 'Info Update Log', timestamp:1467638126285},
  {level: 8, message: 'Debug Entry Content', timestamp:1467638316285},
  {level: 16, message: 'Verbose', timestamp:1467648116285},
])
console.log("%cBe Careful Using The Console !", "color: Red; font-size: x-large");
//]]>
</script>

Selesai Simpan Templates

Reference :

Console.log() - Web APIs | MDN

Console API Reference

Getting Info...

3 comments

  1. Anonymous
    This comment has been removed by a blog administrator.
  2. testing
    [pre]
    function cdClear() {
    var wtarea = document.getElementById('codes');
    wtarea.value = '';
    wtarea.focus();
    document.getElementById('cvrt').disabled = false;
    }[/pre]
  3. test kode
    [pre][code]$(document).ready(function() {
    $("#flippy1").click(function() {
    $("#flippanel1").slideToggle("normal");
    });
    // spoiler 2
    $("#flippy2").click(function() {
    $("#flippanel2").slideToggle("normal");
    });
    //spoiler 3
    $("#flippy3").click(function() {
    $("#flippanel3").slideToggle("normal");
    });
    });[/code][/pre]
Agiel Triono Comment Policy

Do not include spam link !
Please read our Comment Policy before commenting.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.