/    Sign up×
Community /Pin to ProfileBookmark

Is there any way I can allow access to a JS via the <script> but not directly?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Apr 04.2010 — With PHP you probably can, however, you should be aware of [url=http://www.webdeveloper.com/forum/showthread.php?t=26841]this thread[/url].
Copy linkTweet thisAlerts:
@rnd_meApr 05.2010 — Is there any way I can allow access to a JS via the <script> but not directly?[/QUOTE]

no, but you can serve them under a scary mime-type to discourage reading it in a browser, which is admittedly one of the first things i do. application/octet-stream is a good one.

the script tag itself ignores mime types...
×

Success!

Help @josheee12 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...