My problem is to execute a function when a new page is loaded. I have two pages (index.html and location_page.html). In the first one there is a list of labels. When the user click on one element of this list, he is redirected to the second page that should dynamically load the info associated. I tried to use function ready
but it doen't work. Here is my jQuery code
$("#location_title").ready(function(e){
console.log("executing the function");
});
and here is the HTML
<div class="location_info">
<div class="location_text">
<div id="location_title"></div>
<div id="location_description"></div>
</div>
<div class="location_img"><img src="./img/strutture01.jpg" class="location_image"/></div>
</div>
The first page also has a method like this (i call a 'ready' function) and it works, but it doesn't works on the second page.