473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hide Javascript From View Page Source?

chunk1978
224 100+
hi there,

so i vaguely remember viewing the source code to some internet sites, which appeared much shorter compared to the lengthy, complex content that was actually displayed... i'd like to know if there's a way to hide the script portion (or all portions) of an internet site from being viewed in a browser's "View Page Source"...

thanks.
Feb 21 '07 #1
3 2036
acoder
16,027 Expert Mod 8TB
No that is not possible, because whatever techniques you use, anyone with some technical knowledge will be able to easily obtain your scripts. For example, you can use:
[HTML]<script src="js/myjsscript.js"></script>[/HTML] but I can easily download or view that script.

Other techniques to 'hide' javascript involves encoding it and also including a decoder, but that is never foolproof, e.g. see this link.
Feb 21 '07 #2
d3vkit
35
Other techniques to 'hide' javascript involves encoding it and also including a decoder, but that is never foolproof, e.g. see this link.
Doesn't compressing your js make it harder to steal? Or is there a way to decompress it? Is the compression just the encoding that you linked to?
Feb 21 '07 #3
acoder
16,027 Expert Mod 8TB
Doesn't compressing your js make it harder to steal? Or is there a way to decompress it? Is the compression just the encoding that you linked to?
Yes, it does make it harder to steal, but if someone is determined enough, he can discover your algorithm and decode or decompress the code - that's why it's not completely foolproof. Remember you have to include the decode algorithm on the page.
For Javascript compression, you can look at this and Dojo's Shrinksafe (linked on that page).
Feb 22 '07 #4

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

Similar topics

10
by: Mark | last post by:
Sorry, I'm a newbie to php ;) I was thinking about using php to write the script file, something like: <script type="text/javascript" src="http://insert_url_here.com/myScript.php"></script> ...
5
by: Mark | last post by:
Hi - I have a function which shows/hides a <div> on my page - this appears to oinly work in IE, but I also need it to work in Netscape 7.1. My function is in my head: function openIt(faq) {...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
13
by: Fernando Fernández | last post by:
Hi people :)) I am Fernando and I have made a web application with HTML and JavaScript. Now I would like to hide the source code, or at least my JavaScript source code. Is it possible? is there...
47
by: SOLAV | last post by:
This is the only working way to completely hide your JavaScript code from the client just like PHP or ASP code. Here we'll need the help of PHP. Here is the code: index.php...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.