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.
Aneurysm
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Wed Apr 28, 2010 3:30 pm
Location: Italy

Include javascript .js file only in selected articles

Postby 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
Jeyjoo
Joomla! Explorer
Joomla! Explorer
Posts: 341
Joined: Tue Jul 19, 2011 8:56 am
Location: Monaco
Contact:

Re: Include javascript .js file only in selected articles

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


Return to “Extensions for Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 9 guests