473,651 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java script doubt i want protect the java script code without view source

7 New Member
hai

just tell that how can i protect the java script code without seeing view source

it should not the code.

i want function to perform
Jan 25 '07 #1
9 1832
r035198x
13,262 MVP
hai

just tell that how can i protect the java script code without seeing view source

it should not the code.

i want function to perform
Maybe should have asked in the Javascript forum.

Do not put the Javascript in the HTML files. Simply put a link to the source of the js so that all people can see is a link of where the scripts are coming from not the scrips themselves
Jan 26 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Why do you want to hide Javascript anyway? If it's important info. that shouldn't be viewed by the user, use the server side language.
Jan 27 '07 #3
Banfa
9,065 Recognized Expert Moderator Expert
Do not put the Javascript in the HTML files. Simply put a link to the source of the js so that all people can see is a link of where the scripts are coming from not the scrips themselves
This wont help against anyone with 1/2oz of knowledge.
Jan 27 '07 #4
Ganon11
3,652 Recognized Expert Specialist
Moving this thread to the Javascript forum...
Jan 27 '07 #5
mgast
9 New Member
Try using

Expand|Select|Wrap|Line Numbers
  1. document.oncontextmenu = function() { return false; }
Be warned though - this will disable right click on ALL types of elements, including some you may want to grant access to. It also won't prevent them from clicking view -> page source in the browser menu.
Feb 5 '07 #6
UniDyne
18 New Member
Let me start by saying all the techniques for hiding JavaScript code can be exposed. It is a script language; it gets interpreted, not compiled, so the source always remains intact in some fashion.

If IE is the only thing you are going to use, then you can "encode" your javascript into .jse files.

http://www.microsoft.com/mind/0899/s...riptengine.asp

This is really nothing more than a special Base64 encoding.

If you want compatibility, you can use the Crunchinator, which makes the JS harder to read by eliminating all white space and formatting:

http://www.brainjar.com/js/crunch/

Or, you can use Huffman compression on your JS:

http://rumkin.com/tools/compression/compress_huff.php
Feb 6 '07 #7
nmsreddi
366 Contributor
Hello

The simple and easiest way just write java script in .js file and call that link in your html code.
Feb 6 '07 #8
acoder
16,027 Recognized Expert Moderator MVP
Let me start by saying all the techniques for hiding JavaScript code can be exposed. It is a script language; it gets interpreted, not compiled, so the source always remains intact in some fashion.

If IE is the only thing you are going to use, then you can "encode" your javascript into .jse files.

http://www.microsoft.com/mind/0899/s...riptengine.asp

This is really nothing more than a special Base64 encoding.

If you want compatibility, you can use the Crunchinator, which makes the JS harder to read by eliminating all white space and formatting:

http://www.brainjar.com/js/crunch/

Or, you can use Huffman compression on your JS:

http://rumkin.com/tools/compression/compress_huff.php
I definitely would not recommend anything IE-specific especially with more and more people using other browsers. The others are viable options, though as you mention there are no foolproof solutions. One other possibility is to use an encode/decode option as described here.
Feb 6 '07 #9
acoder
16,027 Recognized Expert Moderator MVP
Hello

The simple and easiest way just write java script in .js file and call that link in your html code.
Then I can just look in the source code using View Source, see the link to the file and download the file to view for my pleasure!
Feb 6 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

9
5327
by: FISH | last post by:
Ever have one of those days when you're not sure if it's you who's gone mad, or the rest of the world? I have an Open Source project on SourceForge for communication with YSMG - Yahoo's IM protocol. I keep the project source in three directories, based upon the code's function: one for the network API code itself, one for the support APIs (basic chat spam filtering, Swing models, rich text decoders, etc), and one for the test client...
114
9815
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
3
2363
by: Alexander Fillips | last post by:
Hi, my short question: is there a python object which can interpret java-script? the whole story ;-) I wrote some streaming-scripts for the xbox mediaplayer which supports python. for a new script i tried to filter the stream-url from an
133
8529
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
34
3312
by: kpg | last post by:
Hello all, I have an asp.net web application with tons of Java script files. I would like to protect the Java Script somehow so it can't be seen by a remote user. I found several 3rd party solutions, but I thought I remember that there was a way to 'compile' java script and use that instead of the actual script?
1
9623
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
11
1614
by: Dave Schwimmer | last post by:
I am relatively new to PHP. One of the things that seems glaring obvious to me (coming from a C/C++ background) is how 'open' everything seems - (AFAIK). For instance, URLs typically have the name of the php script that they are calling - also just viewing the source of most web pages will show you in glorious detail, the paths and names to any PHP scripts they may be using. If one was to implement user authorisation (or any other module...
2
1926
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40). (the included config is just server settings, the login is just a login form). The script appear to connect but will not redirect users, it seems that even with correct login details, it won't validate.
5
6275
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is JDK 6 downloadable from http://java.sun.com/javase/downloads/index.jsp. I will be using JDK 5(update 8)
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.