|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript encryption
how can i encrypt a javascript.. not the whole html page. i want only the js file to be encrypted.
|
|
#2
|
||||
|
||||
|
I'm not sure why anyone would want to... buy try searching google for obfuscated javascript
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
Why?
Encrypting your code will only make it run slower. Almost everyone I've encountered who wants to hide their code doesn't write very good code in the first place. |
|
#4
|
||||
|
||||
|
Quote:
*amen*! |
|
#5
|
|||
|
|||
|
hi
I also want to add something, 1) who the hrl is going to copy the code from a running website, there are lots and lots of tutorial sites, and fourms are available, 2) If you will copy somebodys code,( specially in javascript there are more than 2 ways to do any thing so it will take you to long to under stand what is done by other person. 3) I tried once the code of google i copied the JS of google but i was not able to under stand it tooks me 5 hour the format the code before i could start understanding it. So whats the moral of the story......... forget about the encryption of javascript, use that time develop something more awesome thing, still we are not utilizing the concept of web more than 20 - 30% |
|
#6
|
||||
|
||||
|
encryption
:twocents:
I can think of only 2 reasons why someone would want to encrypt javascript. 1. They (think they) have the greatest script going and don't want anyone else to have it. 2. They are trying to do something underhanded and don't want users to easily see what they're up to. @itsmerohi, I will give you the benefit of doubt and assume that you don't want this for some evil purpose, (and I wouldn't help if you did). Perhaps you do have some script that you worked hard on and now you're attached to it and want to "own" it. But consider that, as already said, there are many sources online for javascript. Prototype, Rico, Epoch, Scriptaculous, GreaseMonkey, and more to be sure, all do some amazing things and are Open Source and Free. Perhaps rather than "closet away" your script, you should make it available. Put in the typical "created by... use but keep this comment intact" type of comment in the script and get traffic to your site as a result. Who knows, you may end up having the site grow bigger than you alone can keep up with and have a growing community of users. |
|
#7
|
||||
|
||||
|
NOT ALL PEOPLE WHO ENCODE JAVASCRIPT ARE BAD PROGRAMMERS/HAVE BAD CODE
well not everytime because sometimes they are trying to save valuable information or src's |
|
#8
|
||||
|
||||
|
somewhat encoded text
within javascript you can call javascript files (.js) by the coding...
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="file2call.js"><\/SCRIPT>'); and if you need to enscript a whole js file you may be able to use the escape() and unescape() encoders that is primarily used in cookies. to use this, say we had the following.... //FILE NAME="test.js" var songurl="http://www.songsrc.com/songsrc.mp3"; you can instead encode this and the result will be... //FILE NAME="test.js" var songurl=unescape("http%3A%2F%2Fwww.songsrc.com%2Fsongsrc.mp3"); a good place to encode stuff is... http://www.yuki-onna.co.uk/html/encode.html please email me colton --myweb: http://www.freewebs.com/colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Javascript encryption |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|