Chrome developer tools using validation functions inside script tags

I looked at google and I can’t figure out how to use the dir () function on the webpage I'm working on, I would like it to spit out debug statements as I use to do with Firebug.

Clearer example

I want to do the following.

<script>
a=document.getElementById('gabber');
dir(a);
</script>

However, an undefined error occurs.

+3
source share
4 answers

console.dir works for me:

console.dir(document.getElementById('foo')); 

You can see all the functions available on the console, for example:

for (var n in console) {
  if (typeof console[n] == "function") {
    console.log(n);
  }
}

(I get the following in Chrome 5.0.322.2 :)

debug
error
info
log
warn
dir
dirxml
trace
assert
count
markTimeline
time
timeEnd
group
groupEnd
+14
source

The console can be found at:

  • Instinct element
  • Click Scripts at the top

: console.log().

0

console.log(var)? javascript- (Ctrl + Shift + j), .

Chrome http://img411.imageshack.us/img411/1739/chromeconsolelog.png

0

"jQuerify" --- jQuery Chrome Console , . , jQuery .

jQuery , . jQuery ( Chrome "Ctrl + Shift + j" ).

To insert jQuery in the selected tab, click the extension button.

LINK to extension: https://chrome.google.com/extensions/detail/gbmifchmngifmadobkcpijhhldeeelkc

0
source

Source: https://habr.com/ru/post/1735081/


All Articles