Question:
How can we hide HTML source code from users? This website is created with Java Script language.
Answer:
put the HTML in a <div id="theDiv"> tag call the javascript function in any event like (onLoad ,onClick etc)
document.getElementById("theDiv").style.vibility=hidden;
Source: CoolInterview.com
Answered by: N SUMIT | Date: 10/11/2008
| Contact N SUMIT
We can't restrict the user to see your code this can be done using developing the content in SWF format. Even you disable right click user can see the code through browser view property Source: CoolInterview.com
Answered by: sam | Date: 10/31/2008
| Contact sam
var message="Sorry !!! Right Click is Disabled!";
function clickIE4() { if (event.button==2) { alert(message); return false; } }
function clickNS4(e) { if (document.layers||document.getElementById&&!document.all) { if (e.which==2||e.which==3) { alert(message); return false; } } } Source: CoolInterview.com
Answered by: Aravinth.K | Date: 11/11/2008
| Contact Aravinth.K
This is a misnomer. You can't hide source code, you can only obfuscate it using techniques above. With JavaScript debuggers (ie: IE developer tool and FireBug), you can easily select the dynamically generated HTML elements (in this case '<div id="theDiv" />') and view it's dynamic nested html code. Source: CoolInterview.com
Answered by: andrew | Date: 4/19/2009
| Contact andrew
We can use the Frameset tag inside the javascript part.call the actual text content HTML file in the frameset. Source: CoolInterview.com
Answered by: Gnanavel | Date: 7/13/2010
| Contact Gnanavel
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|