Forums

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

JS in the Custom HTML edit page for Mobile

d jackson
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!
June 6, 2018

Hi.

 

  • I'm trying to add some JS into the Custom HTML edit page for Mobile.
  • I'm adding the code into the End of the Body section
  • I'm trying to select the #rwmi_header element, using AJS.$('#rwmi_header')

 

For some reason, the #rwmi_header element is not found. I know the AJS.$(element) code does work in principle, as i select elements which exist in the Desktop view with no problems

eg.

AJS.$('#rw_footer_container').append('<a  href="https://www.oursite.com">Home</a>');

 

Does anyone know if the various '#rwmi-xxx' elements are themselves added to the code via JS - thus might not exist in the Document at the point where the Custom HTML > End of the Body code is triggered.

 

This is my full code for ref. I'm trying to append a link to #rwmi_header

(Custom HTML > At the end of Body)

<!-- add Home link text onto Mobile -->
<script type="text/javascript">
AJS.$('#rwmi_header').append('<a style="color:white;font-size:1.5em;padding-left:.65em;" href="https://our-secret-special-url">Home</a>');
</script>

 

FYI- I'm more of a CSS person - thus my coding skills are limited.

Thanks in advance :-)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events