Welcome, Guest
Username: Password: Remember me

TOPIC: Adding a JS file?

Adding a JS file? 08 Jun 2012 03:39 #2509

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
I need to add a link to a javascript file on some view pages of my components.

Is this a question I can ask here -- i.e., Where/how should I insert the code for this?

thanks once again,
Geoff
The administrator has disabled public write access.

Re: Adding a JS file? 08 Jun 2012 04:09 #2511

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
If your JS file is required only for one particular layout, then place your code in the concerned VIEW file.

If your JS file is required for your whole component, then place it in the helper file (function : headerDeclarations() )

Note : Always use the Joomla framework syntax to load JS and CSS files.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Adding a JS file? 08 Jun 2012 04:45 #2513

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Great, thank you.
The administrator has disabled public write access.

Re: Adding a JS file? 12 Sep 2012 06:58 #3534

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
>What are the "helper" files? Where are they located?

Sorry, I found them! - I didn't think to look in the admin folders.

regards,
Geoff
Last Edit: 12 Sep 2012 07:10 by geoffr. Reason: solved.
The administrator has disabled public write access.
Time to create page: 0.053 seconds

Get Started