<script>
function DisplayTag(){
var q1=document.getElementById( 'ctl00_ContentPlaceHolder1_ctl00_ctl00_Showcase' ).childNodes[1].innerHTML;
var counter1=0;
function executeScript(q1,counter1){
q1= document.getElementById( 'ctl00_ContentPlaceHolder1_ctl00_ctl00_Showcase' ).childNodes[1].innerHTML;
if(q1.match(/loader.gif/)){
counter1=counter1+1;
setTimeout(function() {executeScript(q1,counter1)},100); //100 milliseconds
}else{
function showTaggedImages(){
var refrencestring = document.getElementsByClassName('mtb-desc');
var maindiv = document.getElementsByClassName('bucket');
for(var i=12;i<maindiv.length;i++){
var current_bucket = maindiv[i];
alert(current_bucket.firstChild.firstChild.innerHTML);
}
}
showTaggedImages();
}
}
executeScript(q1,counter1);
}
DisplayTag();
</script>
After the initial page load my script is functioning correctly. However, when another link is clicked on the same page and new content is displayed, the script does not run. How can I ensure that the script runs when this new link is clicked?