Search the Community
Showing results for tags 'include file'.
-
Background: In C++, I can put a group of definitions into a separate file, and then in the C++ source, do a "#include <include_file_path>" to bring those definitions into the C++ file at the desired location. An example would be putting basic physics constants (gravitational constant, electron charge, dry gas constant, electron mass, speed of light in a vacuum, Plank's constant, etc.) into a file "physics_constants.H", and then a physics application program would have a line #include "physics_constants.H" In a JavaScript, I have an array of photo captions (text). Here's a piece: var captions = [ "Longs Peak on March 17, 2016" + "<br />" + "Colorado, USA" , "Mt. McKinley on January 19, 2015" + "<br />" + "Alaska, USA" , [etc.] "Medicine Bow Peak on February 14, 2000" + <br/>" + "Wyoming, USA" ]; The array actually has 58 entries. Rather than embedding that into the JavaScript (which is in turn a part of an html file), I'd like the array definition to be in a separate file by itself, and then put a JavaScript equivalent of the C++ "#include <include_file_path>" at the appropriate place in the JavaScript. Questions: Does JavaScript have such a capability? If yes, how do I do it? Thank-you for your help. Bill.
-
I have an ASP page that an outside company is requesting via AJAX. I've added "Access-Control-Allow-Origin", "*" to the response.addheader and everything works just fine. As soon as I add an <--#include file-->, the page does not work anymore. Can anyone tell me if this page structure is not allowed, or am I just doing something wrong? Thanks,