technically, as long as a browser can display the page, the page's source can be seen and read. You can ~encrypt the data inside Javascript, but that only deters the casual person. Can we ask why you want to disallow viewing your source?
well, you should realize that theres really nothing you can do to prevent it.
the average person prob couldnt get past a right click disabled or a javascript encrypting, but the average user prob has no care to read your html source either.
the person who would have a desire to read your source, can prob get around whatever you do fairly easily.
This may be an odd question - but how is a project not being open source an encouragement to obscure html markup? I mean all your markup in the end is going to be standard HTML. Any decent author could replicate the display in their browser within a short time.
and if I was really hell-bent on stealing your HTML I could use use get under Linux and there's nothing you could do against that.
Why would you be concerned about HTML? Javascript - I believe there are things like encoders for it, but that's as far as it goes. You have to live with the fact that whatever you put in front of the public's eyes, it'll be looked at.
well ... it was just curious if it was possible. As you guys mentioned nothing can be done to totaly hide the HTML code ... and there is no good reason for that as well.
2. In the page that the user would call, say index.htm, use window.open (make sure to somehow get pass the popup blocker) to open dom.htm.
3.have dom.htm first call window.opener.document.write() to erase the page source of index.htm . THEn use DOM functions to create ur original page, using createElement.(i forget the exact function name) then window.close();
Now when a user tries to view index.htm's page source, he/she will find it empty.
If you try and hide code of any sort it often makes users more interested in what is going on and will encourage people to dig around, especially on a web site with technical people on it. Leave the HTML visible and people will generally ignore it. If you don't want javascript readable you can encode it with encoders but I read an article somewhere (cannot remember where unfortunately) which discussed these and the came up with the result that they are fairly easy to crack. The main reason for encoding the Javascript is to compress it for quicker download times.
2. In the page that the user would call, say index.htm, use window.open (make sure to somehow get pass the popup blocker) to open dom.htm.
3.have dom.htm first call window.opener.document.write() to erase the page source of index.htm . THEn use DOM functions to create <span style='color:blue' title='ignorance is bliss'>your</span> original page, using createElement.(i forget the exact function name) then window.close();
Now when a user tries to view index.htm's page source, he/she will find it empty.
I disable Javascript with one click in my browser. And what if people have Javascript disabled by default?