Calling Javascript function in Richtext source editor href | Community
Skip to main content
Level 2
July 31, 2018
Question

Calling Javascript function in Richtext source editor href

  • July 31, 2018
  • 4 replies
  • 1813 views

Hi All,

I am putting the below html code in Source editor of Richtext, but it is removing the href attribute. Can anyone please tell me if I need to add any context while displaying the RTE. I am already using @context=''html'

<div class="back-button">     

                    <div class="container">

                        <a href="javascript:history.back();"><i class="fas fa-chevron-left"></i> Back Button</a>

                    </div>

                </div>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

arunpatidar
Community Advisor
Community Advisor
July 31, 2018

Hi,

you may need to add a rule to preserve href if starts with javascript

Experiencing Adobe Experience Manager - Day CQ: AEM 6 SP2 - Handling Custom Protocol in Link Href in Rich Text Editor

Thanks
Arun

Arun Patidar
smacdonald2008
Level 10
July 31, 2018

If you want logic in AEM that fires JS - why use the RTE as opposed to a component?

Jitendra_S_Toma
Level 10
July 31, 2018

You need to HTML source editor to put HTML Code & Javascript. RTE Component has this.

edubey
Level 10
July 31, 2018