By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,432 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,432 IT Pros & Developers. It's quick & easy.

Old issue: Hiding Javascript

P: 2
Hello All,

I've read a lot of stuff which says it's impossible to hide Javascript, so if I get my PHP script to return some Javascript inside some XML using AJAX, how can it be viewed in the browser?

Obviously, some essential Javascript has to be there at the outset, ie. that which handles the AJAX, so you can't hide that, but if you then use AJAX to supply ad hoc Javascript on demand, can it be seen anywhere?

Your technical observations are most appreciated. Thanks for your time and attention.

Regards.
Dec 22 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Yes. Try, for example, Firebug (Firefox add-on).
Dec 22 '09 #2

P: 2
Hey, thanks! Firebug is cool.
Dec 23 '09 #3

rnd me
Expert 100+
P: 427
ajax uses the same URLs that can be viewed in a browser by placing them in the address bar.

the only way you can hide is with ciphering. here's an app i made that can encode a whole webpage, javascript and all. But, your visitors would need to know the password to view it...

using something like dean edward's packer makes the code look like gibberish, but it's still easy for developers to "roll back" to the real code.

In short, javascript must eventually be delivered to the javascript engine as plain-text code.
that makes it impossible to truly use code without being able (perhaps with difficulty) for humans to read the code.
Dec 23 '09 #4

Post your reply

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