i'm not sure where i should ask this...so i thought i would venture here...
here's the deal. i have a javascript file that contains a whole mess of functions for a specific page on a site. now, i would like to keep these functions secret.
obviously, anybody can call up and view a javascript file. but i'm wondering if it was really a php file (like stuff.js.php) that was both outputting the text file javascript stuff and also had some security code in it such that if a person tried to view it directly, a script would catch that the referrer was not one specific page and therefore not show them the javascript...
does that make sense? it's just an idea that popped into my head. i'm not sure if this would be prudent or not. and if i can't secure the page in mention, i'm not bothered by that either...
EDIT: seems to work very nicely, but I'm not sure about just how reliable the referrer information would be. if it worked 95% of the time i think it would be worth it. and i wonder how easy it would be to spoof, but hackers would have to guess as to what i've done with the string and how i did it...not such an easy task i believe...
thoughts?
v