Ask coding questions

← Back to all posts
Get innerHTML of page
Coder100 (17021)

I have a website that is not on the root domain (meaning if my parser page was on the page to be parsed is on

import 'jquery';//pretend this works

Now I want to use axios to parse the <p> tag.
Now, Axios obviously will say
but I want it to say woooYeet as the javascript will append that (pretend you can import jquery).
How would I do this so Axios would evaluate the javascript code?

And more importantly...

What if you had a backend that posted the code automatically, so for security reasons, you would have to dynamically get the innerHTML?

For example,

<script src = ""></script>

had content of

import 'jquery'; // this works because I say so

And for some reason you couldn't parse and you would have to actively wait 5 seconds for to do its magic and replace the html of <tag>. So how do you do that?

Thanks in advance!

Zavexeon (1188)

Hey, I don't have an answer, but the way you asked this question was excellent!

MatthewDoan1 (336)

Have you tried putting the Axios code after the Jquery code? (I think your code runs in order.)

MatthewDoan1 (336)


<script></script> <!--Jquery stuff -->
<script></script> <!--Axios stuff-->

Since HTML5 goes down the document, like Python, I believe this will work, since the Axios code runs after the Jquery code.

Coder100 (17021)

I don't think it will work like this, you would have to async it because javascript actually goes by first come first serve if something takes too long to load and is not specifically specified to be important
so either like

<script></script> <!--Jquery stuff -->
<script>async args</script> <!--Axios stuff-->
<script></script> <!--Jquery stuff -->
<script>setTimeout(function(){args},5000)</script> <!--Axios stuff-->


Coder100 (17021)

Oh, ok. See, it is synchronous until it isn't @MatthewDoan1