Showing console errors and alerts in a div inside the page

后端 未结 7 728
梦毁少年i
梦毁少年i 2020-12-02 09:10

I\'m building a debugging tool for my web app and I need to show console errors in a div. I know I can use my own made console like object and use it, but for future use I n

7条回答
  •  不思量自难忘°
    2020-12-02 09:34

    How about something as simple as:

    console.log = function(message) {$('#debugDiv').append('

    ' + message + '

    ');}; console.error = console.debug = console.info = console.log

提交回复
热议问题