SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: a script to block a js file
-
May 16, 2007, 13:32 #1
- Join Date
- Mar 2007
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
a script to block a js file
i have a javascript file on my server and i am looking for a script i can use to make it so that a user can not just type the address of the javascript file in the address bar and see it.
is it possible to make it so the file can't be viewed alone. i know that can be done with css.
Thanks
-
May 16, 2007, 14:20 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Please don't double post.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
May 16, 2007, 23:30 #3
- Join Date
- Jan 2007
- Location
- Australia
- Posts
- 137
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It can't be done. If you want the user to be able to execute the script from within a web page, but not enter the URL into their address bar and see it, its impossible. Why would you want to hide your JavaScript anyway? Otherwise, you can encrypt your javascript using the javascript compressor / obfuscator.
Check out my SitePoint articles and blog posts!
-
May 17, 2007, 00:10 #4
- Join Date
- Apr 2007
- Posts
- 813
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
send a malicious code to turn off their javascript support, when visitors come back to the page, no javascript run
-
May 17, 2007, 05:31 #5
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Decent web browsers don't allow the web page access to turn off javaScript. My browser has a button in the status bar I can press to turn it on and off as needed so even if someone did manage to find a hole in my system security and turn it off I would have it turned bacl on with one mouse click.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
Bookmarks