Old issue: Hiding Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drewdall
    New Member
    • Dec 2009
    • 2

    Old issue: Hiding Javascript

    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.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Yes. Try, for example, Firebug (Firefox add-on).

    Comment

    • drewdall
      New Member
      • Dec 2009
      • 2

      #3
      Hey, thanks! Firebug is cool.

      Comment

      • rnd me
        Recognized Expert Contributor
        • Jun 2007
        • 427

        #4
        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.

        Comment

        Working...