Global variables are defined on the window
object, so you can use:
var MyVariable = "Value of variable";
alert(window["MyVariable"]);
More Related Contents:
- Substraction two textbox values with jquery [duplicate]
- How do I empty an array in JavaScript?
- Get selected value in dropdown list using JavaScript
- How do I work around JavaScript’s parseInt octal behavior?
- Why would a JavaScript variable start with a dollar sign? [duplicate]
- Using HTML5/JavaScript to generate and save a file
- Capturing javascript console.log? [duplicate]
- Best way to call an asynchronous function within map?
- How to display data values on Chart.js
- javascript access parent DOM across domains?
- Check whether an array exists in an array of arrays?
- D3 Appending Text to a SVG Rectangle
- Dot and Square Bracket Notation
- jQuery: how to change tag name?
- Best way to store a key=>value array in JavaScript?
- JavaScript parseFloat in Different Cultures
- iframe shimming or ie6 (and below) select z-index bug
- Reference ASP.NET control by ID in JavaScript?
- How to add anchor tags dynamically to a div in Javascript?
- What’s the time complexity of array.splice() in Google Chrome?
- What does the “$” sign mean in jQuery or JavaScript? [duplicate]
- What is better, appending new elements via DOM functions, or appending strings with HTML tags?
- Check whether HTML element has scrollbars
- How can I save information locally in my chrome extension?
- Leaflet marker event fires at wrong time
- Webpack not excluding node_modules
- How to convert array of key–value objects to array of objects with a single property?
- Allow text box only for letters using jQuery?
- Count console.log objects
- FB.logout() called without an access token