[thelist] ASP to populate .js file?

Stephen Caudill SCaudill at municode.com
Wed Apr 7 09:58:49 CDT 2004


--------------- david.landy at somerfield.co.uk wrote: --------------- 
 
: That was my first thought, too, it's simple and straightforward.
: The trouble is, if different users get different versions of the
: menu depending, say, on their access rights, you'd have to
: generate lots of different .js files with different names.

I concede that in a multiuser environment where the data in the .js
files depends on user variables, this would be a problem.  It could
be handled by appending the sessionID to the filename, but in a 
10,000 user scenario, that's a hell of a lot of disk space and 
processing power, willy nilly creating and destroying objects and
writing to files and deleting them all dynamically... yuck!

However, If the original poster merely want's to generate a .js 
file based current database information that is not user dependant,
this isn't a bad solution.  It will make only a bit more of a 
performance hit than running any dynamic page on the site.
 
: :(
: 
: Wouldn't it be simpler and more elegant to use the dynamic
: solution proposed earlier today, in which an ASP page outputs js
: on-the-fly? 

Simpler? I don't think so.  More elegant?  Not if you adhere to any
ideal of semantic correctness of file contents.

If you want an ASP file that dynamically writes JS, why not just 
have the ASP file that wants this .js file create inline JS? This
way, everytime the page is hit, it generates the JS for the 
requesting user only.  Not creating a .js file that hangs around 
from user to user.

The original poster didn't explain why he wanted to achieve the
effect he was looking for and the whole thing sounded flawed to me
from the outset, but I just tried to answer the question.  I think
for any real resolution, Christian will have to resurface.

I enjoy the debate regardless though :)

-Stephen
http://www.mechavox.com/



More information about the thelist mailing list