Re: Javascript equivalent of #include or @import?
I use the following to include any file on the server :
<!--#include file="yourfilen amehere.js"-->
I'm not sure what support you need to run it. I use ASP for my server side
programming but this
isn't asp.
Anyway, try it, if your server has even minimal support it should work.
Remember, this is happening on the server. Javascript runs on the client. I
fail to see how
using javascript document.read or write is going to work unless everyone who
visits your web page has the
files on their computers!
"gendem" <gendem@yahoo.c om> wrote in message
news:in4h00he9i lt5navjh6hvcdud 0lt6jea7u@4ax.c om...[color=blue][color=green][color=darkred]
> >>> I'm wondering if there's a way to include other pieces of javascript
> >>> code from *within* javascript.... a la #include in C, @import in Java,
> >>> use/require in Perl, include()/require() in PHP, etc....
> >>
> >> Not in general, no. If you want to include it while the page is being
> >> loaded, you can use document.write to write a new Javascript tag:[/color][/color]
>
> Rats. I'm trying to script in PhotoShop, which uses Javascript, and
> it sure is a waste to have to copy code around instead of just
> including it. I guess it's a limitation of not seeing all potential
> uses of a language before hand. Oh well.[/color]
I use the following to include any file on the server :
<!--#include file="yourfilen amehere.js"-->
I'm not sure what support you need to run it. I use ASP for my server side
programming but this
isn't asp.
Anyway, try it, if your server has even minimal support it should work.
Remember, this is happening on the server. Javascript runs on the client. I
fail to see how
using javascript document.read or write is going to work unless everyone who
visits your web page has the
files on their computers!
"gendem" <gendem@yahoo.c om> wrote in message
news:in4h00he9i lt5navjh6hvcdud 0lt6jea7u@4ax.c om...[color=blue][color=green][color=darkred]
> >>> I'm wondering if there's a way to include other pieces of javascript
> >>> code from *within* javascript.... a la #include in C, @import in Java,
> >>> use/require in Perl, include()/require() in PHP, etc....
> >>
> >> Not in general, no. If you want to include it while the page is being
> >> loaded, you can use document.write to write a new Javascript tag:[/color][/color]
>
> Rats. I'm trying to script in PhotoShop, which uses Javascript, and
> it sure is a waste to have to copy code around instead of just
> including it. I guess it's a limitation of not seeing all potential
> uses of a language before hand. Oh well.[/color]
Comment