It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

958 views 8 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you