I have two html files first.html and second.html. Both are using a file main.js. So lets pretend I am in the second.html and I want to change the window.location.href to first.html. But the same time, I want to call a function, which should be executed in the first.html file just after it is loaded from the second file. So how should I do this. How can I check, from which page the first.html file was called to load?
If I will use the following code,
$(document).ready(function() {...});
The function would be loaded every time, I load this page. But I want to execute the function just, when the page is loaded from the second.html file.
Hope you understand my question.