[thelist] The finer details of javascript

Steve Cook steve.cook at evitbe.com
Fri Nov 8 10:03:01 CST 2002


Interesting idea Rob! I can think of one (untested) way of doing this and
another approach which I have used myself many times.

For the ASP parser to parse a file it must have the file ending in its list
of recognised endings. I don't remember exactly how you do this (it's
probably a setting in the IIS terminal), but if you add .js to the list then
all .js files will be parsed for ASP code before they are served.

Otherwise you will need to change the approach. The main page that is
"calling" the javascript file does the inclusion on the client end, not at
the server. If you cannot change the .js file so it is parses before it is
sent to the client, then you will need to generate the bits of javascript
that have dynamic content within your main asp file instead. You could
include this as part of your page header for instance so that you still gain
the benefit of recylcing your code. This is the way I have gone about doing
such things in the past.

There may be other ways of getting around this, but I know that the 2nd
version can be used.

Good luck!



-------------------------------------
 Cookstour - http://www.cookstour.org
-------------------------------------

> -----Original Message-----
> From: Rob Smith [mailto:rob.smith at THERMON.com]
> Sent: den 8 november 2002 16:39
> To: Thelist (E-mail)
> Subject: [thelist] The finer details of javascript
>
>
> Hi list,
>
> Once again, I seek your expertise. Here's the story: I've got
> an .htm page
> that has an external .js file "included." In that .js file,
> I'm trying to
> include some .asp stuff. example:
> </SNIP>
>



More information about the thelist mailing list