I've been writing lots of code for many years, but in the past it's never been required to be protected, mainly because the code was written for clients and not myself.
I have lots of JavaScript & jQuery code that I have written, my biggest issues is that I have Ajax requests as well, and these communicate with internal PHP files.
Here's a sample of code from Google:
function Yf(a, b, c) {
c && (b = r(b, c));
if (document.addEventListener) try {
Zf(document, "DOMContentLoaded", b, a)
} catch (d) {
Zf(window, "load", b, a)
} else if (!document.uniqueID && document.expando) var e = document.createElement("tempnode"),
f = window.setInterval(function() {
try {
e.doScroll("left")
} catch (a) {
return
}
window.clearInterval(f);
f = e = null;
c && (b = r(b, c));
b()
}, 50);
else "readyState" in document ? f = window.setInterval(function() {
/loaded|complete/.test(document.readyState) && (window.clearInterval(f), f = null, c && (b = r(b, c)), b())
},
50) : Zf(window, "load", b, a)
}
=====================================
Code comes from this url: http://www.google.com/inbox/assets/js/main.min.js
Online JavaScript beautifier: http://jsbeautifier.org/
Is this obfuscated or is it written this way from the beginning? (Sure, one can follow along and read this code and other lines, but there's no evidence of any Ajax requests that are communicating with an (or several) internal page files)
Similar question might have been posted previously, but bear with me.