Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:33:42+00:00 2026-06-05T10:33:42+00:00

How is it possible to add a .js file in my joomla module? The

  • 0

How is it possible to add a .js file in my joomla module?

The directory structure is like this:

‘ “modulename”/site/js/thefileIneed.js ‘

I tried the following, but that doesn’t work.

$document = &JFactory::getDocument();
$document->addScript(dirname(__FILE__). '/site/js/mainscript.js' );

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:33:45+00:00Added an answer on June 5, 2026 at 10:33 am

    If found this working example in one of our working modules:

    $document->addScript(JURI::Root(true)."/modules/mod_ourmodule/charts.js");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if it could be possible to add a file
Is it possible to add Vault file version number into this file's source?
Is it possible to add a custom css file to a fb:like-box? For example,
Is it possible to add a custom keymap to lynx (in the config file
Is it possible to check in a file or add a file to an
Is it possible for an SQLite data file used by an add-on to be
Is it possible to add an app icon , like it shows in Live
i'm wondering if it's possible to add a php file in your themes folder
Is it possible to add some value from resource file right into the XAML
Is it possible to add ZIP file to APK package as a raw resource

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.