How can I call a javascript function from another page?
Example:
Page5.html
<a href="javascript:irAFuncionDePagina2Html();">Contacto</a>
I add more explanation, I thought it would be better understood with the previous example.
I have on a page a long scroll with a form in a section in a certain "Y" position.
In other pages I have a contact link that when clicked goes to the form on this page pagina2.html with a link of the type
<a href="pagina2#contacto">Contacto</a>
The problem is that for several functions that the page has I have to run it with a JavaScript function where before I scroll the page to position 0,0 in this way,
<a href="JavaScript:scrollHaciaContacto()">Contacto</a>
Where the scrollHaciaContacto function is declared on page2.html
function scrollHaciaContacto() {
window.scrollTo(0,0);
location.href = "pagina2#contacto";
}
That is, before going to the "Y" position of the page I have to scroll to position 0,0.