Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Embedded Script not Running (using custom component that has worked in the past)

Avatar

Level 2

I've got a problem I just can't find the answer to. I'm trying to drop in some embedded content into an HTML Source component (custom component that just sticks code to the page), but the included <script> tag's contents don't appear to be firing despite showing up as a source in Chrome's dev tools. Not even Twitter or Instagram embeds are working and I assume their code is better than ours. Does anyone have some insight to why this might be?

 

For context, this component has worked just fine in the past for us. We wouldn't normally use a custom component like this on newer sites in our system but there are some sites that utilize the older style non-adobe core components. Dropping in a YouTube embed works just fine, but any time a resource needs to fire a <script> tag, it just doesn't do anything in the editor interface, nor the view as published or the published interface.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @abateman325 ,

In AEM, to make a <script> tag work or working with clientlibs is totally different than normal webapps, like lots of dependency needs to be resolved.

Sometimes due to version issue, dependency not available issue such kind of things occurs.

So it will be better to take help from browser's console to troubleshoot it like see if there is an error in it if yes then what is that.

Then after resolving it you can try to run the script from the browser console itself before making it a part of your codebase.

Hope this will help.

Umesh Thakur

 

View solution in original post

2 Replies

Avatar

Level 2
This issue also appears on the Embed core component. It does not run the scripts that we add to the page.

Avatar

Correct answer by
Community Advisor

Hi @abateman325 ,

In AEM, to make a <script> tag work or working with clientlibs is totally different than normal webapps, like lots of dependency needs to be resolved.

Sometimes due to version issue, dependency not available issue such kind of things occurs.

So it will be better to take help from browser's console to troubleshoot it like see if there is an error in it if yes then what is that.

Then after resolving it you can try to run the script from the browser console itself before making it a part of your codebase.

Hope this will help.

Umesh Thakur