I want to set a variable in an external file "Variable.js" and assign it a value in a file "Page1.html" and then use that variable with that value in another file "Page2.html" Let's say I have this file "Variable.js" :
var myVar
The file "Page1.html" with this script:
<script>
myVar="Some text"
</script>
And the file "Page2.html" like this:
<html>
<head>
<script src="Variable.js">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<p id="para"></p>
<script>
$(function() {
$("#para").text(""+myVar)
})
</script>
</body>
</html>
I want to access "Page2.html" through an <a href="Page2.html">
in "Page1.html"
and the value "Some Text" to appear in that <p id="para">
.Is it posible?