Expand my Community achievements bar.

Calling Javascript function in Richtext source editor href

Avatar

Level 2

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>

4 Replies

Avatar

Community Advisor

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...

Thanks
Arun



Arun Patidar

Avatar

Level 10

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

Avatar

Level 9

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