AJS.(document).ready triggering when plugin is not loaded

brunomartinspro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2019

I have a plugin (on the right tab that has the "People" etc) that on refresh works and executes a function that changes images.
I tried document load/ready, window load/ready but when i click in another issue the element is not present - only after full page load.

On a velocity template:

<script type="application/javascript">

AJS.$(document).ready(function(){
    changeImage();  

});


function changeImage(){    

var element = document.getElementById(id);

element.classList.add("myImage"); 

}

</script>

 

How can i define an event that when i navigate to an issue it will only execute when the page is fully loaded?

 

0 answers

Suggest an answer

Log in or Sign up to answer