Hi,
I’m writing a plugin that adds some Information to the issue details view.
Therefore I’m using javascript code to add interactions.
my vm-template looks roughly like this (first HTML-Elements then the javascript parts)
<div id="myContent">my content</div>
<script>
document.getElementById("myContent").innerHTML = "my new content";
</script>
the point is that JIRA seems to reassemble the order of the elements. When I test my plugin the getElementById()
always fails, because the corresponding element is not yet available in the DOM.
btw. using jQuery(document).ready(function() {...});
doesn’t make any difference. Using some blocking interaction in my javascript (e.g. alert()) shows that when it’s executed the JIRA-page is not yet complete. It is incomplete until the blocking event of my code returns (see attached screenshot)
So my question is: how can I ensure, that certain parts of the DOM are available when my script is executed.