InMotion Hosting Support Center

how to use js codes in joomla articles?

Category: Joomla 25

2013-03-24 11:26 pm EST

Hits: 1,681
I followed the steps you described in order to let iframe be shown and it worked and then applied the same steps on the script tag but still i cannot see the js code result on my page. can you plz tell what else i should do?

thank you.

You must login before you can ask a follow up question.

You must login before you can submit an answer.



9,968 Points
2013-03-25 1:23 pm EST
Hello caroleriva, and thank you for your question.

When you click on the HTML source button in the TinyMCE editor in Joomla, are you still seeing your <script> tags there, or have they been stripped out?

If you followed the steps in our how to add an iframe to a Joomla 2.5 article, you should have removed the word script from the Prohibited Elements section. You might also need to make sure your Super Users are set to have no filtering by going to Site > Global Configuration > Text Filters in the admin panel.

If you're still having issues getting it working, it could be the JavaScript code itself and how it's coded. I would recommend trying to insert this test JavaScript and making sure it's not getting stripped out when you save the article:

<script type="text/javascript">
alert("Hello world!");

It looks like Joomla automatically updates it to this after being saved:

<script type="text/javascript">// <![CDATA
alert("Hello world!");
// ]]></script>

However when viewing the page, the JavaScript code is run right away and I get the pop-up message in my browser. If it's still not working for you please let us know.

- Jacob

You must login before you can post a comment about this answer.

Hello Jacob,

Thank you for the reply, i can't see the pop-up message in my browser after adding the code you said, however my js code is now working without making any changes.. looks strange, but it works :))
8 Points
2013-03-27 12:39 am EST
Like this Question?

Joomla Community Google+ Hangout #3

June 3rd, 2014

Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!

Click here to watch!

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!