How do I convert javascript to html?
Take for example this snippet of code on a web page.
<html><body> [removed] [removed]("The cat"); [removed](" sat on the mat"); [removed] </body></html>
If I were to retrieve this web page via CURL or WGET I would get that text because the Javascript has not been processed.
But I would like to retrieve this page, so I get the results of the Javascript output. So I would get just..
The cat sat on the mat
Is there some Linux Javascript sandbox/emulator/preprocessor or something of that ilk that would allow me to process that text into html. I understand Javascript is complex and don't expect 100% conversion. But even to get some basic conversion would be helpful.
I know it's possible as I'm sure Google does that when they index web pages to get the best results for the web pages they index.
Just for the record, there technically is a way to convert JavaScript to HTML.
I use inspect elements in Chrome and FireFox a lot, which is the first place I learned HTML. If you paste a JavaScript in the inspect element, it won't recognize it's function. I found a way around it. I taught myself everything I know which is what made it easier to figure this out. Here is an example:
[removed]
[removed] function myFunction() { document.getElementById("demo")[removed] = "Hello World"; } [removed]
JavaScript to HTML:
getElementById('demo')[removed]='Hello World';
HTML reads HTML codes differently than JavaScripts so I have to simplify the JavaScript to get the HTML code. Technically it is a JavaScript since it carries out the JavaScript function but it is still HTML because it is in HTML form.