0
For example, on a page you have a script tag like this:
<script>var X = "variável que quero pegar";</script>
How could I get this variable "X" on another page just with the url of it and carry to current page? Consider that the page can be external url server.
Variables cannot go from one page to another. If they are from the same site you can use localstorage, cookies and other features.
– user60252
What if you could read the text of the page with Javascript and return the text? for example, read what is between "<script>Content...</script>" and return that content?
– João Victor
With PHP it would be possible
– user60252
I want to avoid the use of the server, I will try with Xmlhttprequest, if not I will resort to it itself, thanks for the suggestion
– João Victor
Dude, what you could do is send a request to the page in question, use a regex or an XML parser to take the value from inside the script tag and then give it a
eval
in this value. But that is braba’s gambs, would only use in last of last case.– Francisco
I understand kkk, but I will try with PHP or Javascript
– João Victor