Solved

hide javascript function

Posted on 2009-07-10
4
249 Views
Last Modified: 2012-05-07
How can I hide a javascript function that is embedded in an aspx page so that when a user does a view->source, then they can't see the particular javascript code. I know there isn't a way to 100% hide it, but some ways to do this are appreciated..
0
Comment
Question by:kuntilanak
4 Comments
 
LVL 7

Accepted Solution

by:
Seo_Expert earned 500 total points
ID: 24821084
Hello,

You can used javascript obfuscation or Obfuscator to scramble javascript.
You can used below url for the same :

http://www.javascriptobfuscator.com/
0
 

Author Comment

by:kuntilanak
ID: 24821446
how do I use the link above? just copy and paste the resulting obfuscated code?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24821513
Yes.

however it is not secure, it will only hide it for someone not very technical
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 24825015
You could put the code into an external file and reference it using the code below. This will hide it from the view source but if you use any plugin for developers you will be able to view the associated javascript. Ultimately the script needs to be processed by the client so it will be sent to the client and is therefore visible.

Cheers,

Lee

<script language="javascript" src="../somelocalpath/file.js"></script>

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question