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.141 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started