I have two html pages that two javascript functions.
page1.html
<a href="page2.html" onclick="ex1()">link1</a>
page2.html
<a href="#" onclick="ex2()">link2</a>
jscript1.js
var abc;
function ex1() {
abc='some text';
console.log(abc);
}
function ex2() {
console.log(abc);
}
In the console, I'm getting undefined when inside the ex2() function. What am I doing wrong here?