JavaScript Includes

Discussion in 'Mac Programming' started by satans_banjo, Jan 1, 2007.

  1. satans_banjo macrumors regular

    Sep 12, 2005
    SE London

    Here's the deal: I've got all of my functions etc. on an external JavaScript file. However, this file also needs to reference a library ( for those interested) but I can't find any way to do this in JavaScript. As far as I can see it doesn't have an include/import function built-in


  2. mbabauer macrumors regular

    Feb 14, 2006
    Here is my understanding:

    JavaScript does not do an "import" feature. The import you are using is actually HTML, and your browser does it for you. I believe what you need to do it just have two statements in your HTML, one to pull in the libs you want, the other to pull in your custom libs. The browser puts these methods into what would be considered a "Global" scope, so calling a method in from your code to the lib code would just work. Consider it PFM (Pure Effin Magic).

Share This Page