简体   繁体   中英

How can I see the output of console.log()?

I am using this code:

<script type = "text/javascript">
 console.log("hello world");
</script>

How can I see the output of console.log() ?

I searched on Google but did not find a solution.

You can open the error console, depending on your browser. (Ctrl+Shift+J in Firefox, or F12 in Chrome, for example). Most browsers have the console hidden in their developer tools.

The console.log(); statement prints anything in the browser console.

Look for Developer Tools or Simply Tools menu in all major browsers.

If you are using Google Chrome the press Cntrl+shift+j to see console.

In Firefox, press Ctrl+Shift+I and click on Console to view the console on Firefox.

You need to view the result in the console. Open the console.

Also, you have a problem with your code.

<script type = "text/javascript">
console.log("hello world");
</script>

Is not valid. Remove the spaces in the script tag, like this:

<script type="text/javascript">
console.log("hello world");
</script>

在谷歌浏览器中按 F12 并单击控制台以查看输出

  1. Open firefox
  2. Go to tools and then add-on.
  3. Search and install an add-on named "firebug"
  4. before reloading your page open firebug and go to console tab.
    You will see your desired result. If you have chrome then its already there. just use it

To see the different ways to use the console in the various browsers please refer to this article:

first of all console.log() of javascript cannot be outputed in your..

you need the javascript console to output it

first

press F12 then click the console label

before refreshing the browser to see your output..

but if your console.log() alternatives for browser is document.write();

您可以添加名为“控制台日志查看器”的 chrome 扩展,然后即使不打开开发人员工具也可以查看日志

For Chrome browser follow these steps:

  1. click on More tools on the right side of the top
  2. click on Developer tools
  3. click on console
<script>
function imadumbperson() {
var me document.getelementbyid('demo');
console.log(me);
}
<script>

if only console can have id and a new variable called selfMessage(); so we can do the same:

<script>
function imadumbperson() {
var me document.getelementbyid('demo');
console.log(me); { id='console' }
var me2 document.getelementbyid('console');
selfmessage(me2)
}
<script>

so if this happend then the console will keep it and then the message will come to us. the best way

due to mathimathics, the console.log(say);<\/code> is not detectable. but it can say what the input it was to the user

<input id='demo'/>
<script>
var myDomain = document.getElementById("demo").innerHTML = 'hello,' + myDomain;
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM