[Webinar] Streamline your web hosting managementRegister Today

x
  • 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?

F1
var config = 'myconfiguration'

F2

var getConfiguration = config
0
CipherIS
Asked:
CipherIS
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.
0

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