hide html code on my website

Joined
May 2, 2007
Messages
74
Reaction score
1
Points
8
Your Mac's Specs
2.0 ghz Macbook
no, because this would be controlled through the browser. the browser needs to see the code to show it as you normally see it and so there is no control on the 'view page source' function.
 
Joined
Apr 23, 2007
Messages
377
Reaction score
4
Points
18
Location
Coatesville, PA
Your Mac's Specs
MBP 15", 2.33 GHz, 2Gb
There are some things you can do to obfuscate code a bit, but for the most part what tyros8000 said is correct. For your browser to display anything, it needs to download the code and render it for the user. You can remove a lot of white space, new lines, rename functions/variables/objects in javascript, link from files, etc which will help render the html less readable to humans.

There are some programs that will do that for you, or you can do it by hand, but make sure you keep an original copy so that _you_ can understand what your pages are doing.
 
Joined
May 2, 2007
Messages
74
Reaction score
1
Points
8
Your Mac's Specs
2.0 ghz Macbook
why do you want to block the code? it is unlikely it will be stolen or anything.
 
Joined
Apr 17, 2007
Messages
225
Reaction score
12
Points
18
There's really nothing in the code (unless you put it there as in meta tags or something) that's going to do anyone any good... I'm a little curious as to why as well? Although, check out www.microsoft.com's web page... one line of code for the home page... LOL
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
He probably wants to hide the code as it's a site dubiously designed to help people boost their google rankings by cross-linking anyone who submits their link.

I would point out that google doesn't appreciate artificially boosting your search ranking and frequently blacklists such sites, so participate at your own risk.
 
Joined
Mar 19, 2007
Messages
1,814
Reaction score
137
Points
63
Location
NY USA
Your Mac's Specs
iMac 5.1 | iMac 7.1 | iMac 12.1 | iMac 19.1 | iPhone 11 Pro | Watch s5
You can use Ajax to load the code in drips and drabs. Then, the would-be code-stealer needs some nifty tools to see the code. I have them =)
But uh... it's a b* to do so. You would need really important/wanted content for someone else to go through the trouble of intercepting the ajax http responses. Especially if it's cryptic.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top