[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 65
  • Last Modified:

javascript - pull variable in from other file

As an example if I had 2 files and I wanted to have one file to contain configs and pull that into a second file, how would I do that with JavaScript?

var config = 'myconfiguration'


var getConfiguration = config
1 Solution
Dave BaldwinFixer of ProblemsCommented:
Javascript scope for simple variables is page wide.  If you load two files with script tags containing those variables, they will be available to all javascript on the page.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now