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

  • Home
  • SEARCH
  • 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 6989279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:11:29+00:00 2026-05-27T19:11:29+00:00

Here is an example: I have a file 1.js, which has some functions. I

  • 0

Here is an example:

I have a file 1.js, which has some functions. I have to make them available to another file 2.js.
1.js is not included in the page, but 2.js is (using src=”).

Is there a way to do this? I do not want to expose 1.js at all to the users, but want to use its functions in 2.js

  • 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-05-27T19:11:29+00:00Added an answer on May 27, 2026 at 7:11 pm

    Description

    JavaScript works on the client (Browser) so you have to make the file available to them.
    Consider to encode and minify the file to make it harder to read.

    More Information

    Online Javascript Compression Tool

    JavaScript Compressor – Compress JavaScript Code Online for Free

    HTML/text/JavaSript Escaping/Encoding Script

    Free Javascript Obfuscator – Protects JavaScript code from stealing and shrinks size

    Update

    1. You can do a Ajax call to get the javascript and use eval. I would do it this way using jQuery .load().

    2. It is possible to include a javascript-file using javascript like this

      function include(filename)
      {
          var head = document.getElementsByTagName('head')[0];
      
          script = document.createElement('script');
          script.src = filename;
          script.type = 'text/javascript';
      
          head.appendChild(script)
      

      }

    Then you can call methods from the other script / source. But this is visible to the user and experienced users will find this.
    Its harder to find as a simple

    <script src="..." type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a csv file that I'm parsing with an example from here:
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
I have reduced down to a small example some code that I have, which
I have a folder called foo. Foo has some other folders which might have
I have a data.frame in R which has been constructed off the Example 1-3
I have a web page which has many divs (listed like table rows), and
Here's the problem. I ,for example,have a string 2500.Its converted from byte array into
This is often situation, but here is latest example: Companies have various contact data
Here's an example of what I mean: I have an array: array('type'=>'text', 'class'=>'input', 'name'=>'username',
Anybody have good examples of usability disasters? Here's an example. Hector is a manager

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.