Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 6th, 2005, 10:16 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to stop user from view js code but still work

Hello
Recently I went to site:http://www.mitsucars.com/eclipse/index.html
I try to get the .js file but I get "Access Denied". Also when I try to get .gif files I get "Access Denied".

How did they do this???
Reply With Quote
  #2 (permalink)  
Old January 6th, 2005, 11:51 PM
Authorized User
 
Join Date: Sep 2004
Location: Delhi, Delhi, India.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

If u want to include javascript in ur page and not to display the code to user then u can create a .js file
and include code like.

<script language="javascript" src="filename.js"></script>



Rekha
Reply With Quote
  #3 (permalink)  
Old January 7th, 2005, 12:37 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

bekim, try this .. http://www.mitsucars.com/js/set_style.js -- you would be able to get the js file. Can you explain what you did to get that "Access denied" error?

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #4 (permalink)  
Old January 7th, 2005, 12:50 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

There isn't any way to stop the users from downloading the .js files. They can type the path of the file in the addressbar and download the full source. On the flip side they can also get it from their cache :) Only thing I could think of is to just encrypt the file and make it difficult for normal developers :) ... Be adviced that good developers can also decrypt the file if they want to.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
Reply With Quote
  #5 (permalink)  
Old January 7th, 2005, 09:08 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

This is very much like the image-protecting issue... it's just not possible. As stated by Vadivel, you logically can't encrypt code perfectly. If it has been encrypted, it must be packaged with a method to decrypt it (to be able to run it) so it really isn't possible to restrict access to client-side scripts you use online.

If there is sensitive information that you need to protect, I suggest going server-side.

-Snib - http://www.snibworks.com
Where will you be in 100 years?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JS to check for form Validation does not work - pl jennypretty Classic ASP Basics 4 December 11th, 2008 11:18 PM
Form and SubForm stop work lijandra Access VBA 0 August 16th, 2006 12:48 PM
Stop the user tapping Brendan Bartley Access 8 January 10th, 2006 08:44 PM
Prevent user input while JS executes matty1stop BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 November 17th, 2005 10:35 AM
How to stop ' stuffing up you code tdaustin Classic ASP Basics 3 June 26th, 2003 09:52 PM



All times are GMT -4. The time now is 09:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.