How do you extract javaScript code from a web page?

I need to reorganize a bunch of html files containing a combination of html and javascript code. I would like to highlight javascript code in order to be able to use various tools (e.g. gjslint).

Is there any way to do this automatically? (I searched, but could not find anything, possibly using the wrong conditions.)

thank...

+3
source share
5 answers

If you want to get javascript with javascript you can use jQuery like

$('script').each(function(){ 
    alert($(this).html()) 
});
+8
source

WebDeveloperToolbar Firefox Information- > View Javascript, scirpts , , .

- .

, <a href"" onclick="">, .

- .

+3

firebug, "script", JavaScripts.

EDIT: , , . , .

+2

, HTML/JS, <script></script>.

0

If you want to extract only tags, you can try it from this site: https://js-download.com/

Here are the tags extracted and the result will be merged into a single file.

0
source

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