Include javascript .js file only in selected articles

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Apr 28, 2010 3:30 pm
Location: Italy

Include javascript .js file only in selected articles

Post by Aneurysm » Sat Jan 06, 2018 4:37 pm

Hi, I was looking for a way to include a .js file only on few articles, I found an extension called JosTag that seems to work good, it includes the .js before the closing head tag and the javascript runs fine, my question is: is there a better way or extension to to this?

User avatar
Joomla! Explorer
Joomla! Explorer
Posts: 342
Joined: Tue Jul 19, 2011 8:56 am
Location: Monaco

Re: Include javascript .js file only in selected articles

Post by Jeyjoo » Wed Feb 07, 2018 10:41 pm

Hi I would put the js inline in the article if very few, or use PHP that detects the page id only adding the .js on the specified page ids.
Ultimate guide to setting up a Joomla MULTILANGUAGE website ... -joomla-3/
Guida siti MULTILINGUE in Joomla ... -joomla-3/

Post Reply

Return to “Extensions for Joomla! 3.x”