Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
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

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
Great, thank you.

Please Log in or Create an account to join the conversation.

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

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
>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

Please Log in or Create an account to join the conversation.

Last edit: by geoffr. Reason: solved.
  • Page:
  • 1
Time to create page: 0.055 seconds
  Love COOKING with COOK It has all the ingredients for a delicious Joomla component!
audibleid (Forum)

Get Started