Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Macro - Displaying elements from other pages

Frederic Fox June 19, 2019

Please note that I am completly new to this and that I am not a developer :)

I am writing a user macro which enables me to insert elements from different pages (as long as they are within a div). The concept is working however the issue occurs when I try to insert the same macro multiple times. 

Instead of adding it x number time it just overrides :(.

 

"Code" below

-----------------------------

<script>
$(document).ready(function(){
var page_url = "$paramPageURL"
var divIdentifier = " #"+"$paramDIVID"
$(divIdentifier).load(page_url + divIdentifier);
});
</script>

<div id = "$paramDIVID"></div>

-----------------------------

I don't understand why I cannot just add multiple elements especially when my div id is unique per insert.

 

Many thanks for your help

 

1 answer

1 accepted

1 vote
Answer accepted
Frederic Fox June 20, 2019

Asking the question helps to solve the issue :) here is what I did to make it work:

<script>
$(document).ready(function(){
var page_url = "$paramPageURL"
var divIdentifier = " #"+"$paramDIVID"
$(divIdentifier).load(page_url + divIdentifier);
});
</script>

<div>
<div id = "$paramDIVID"></div>
</div>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events