Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

hide javascript function

Posted on 2009-07-10
4
248 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

792 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