I want just to disable content copying in IE8. I have found lots of
javascript exaples, but they're not working in IE8 (at least until you
agree to enable the script)
There is ONE trick that might satisfy your client. The content will
still be available to anyone familiar with page construction and
Javascript, but at least a basic "View Source" will not show the
content.
1) In a separate page, or in your Javascript library page, create the
content in a Javascript Function as a single string and assign the
result to a variable.
function createContent() {
var disp = {all your code};
}
You'll also want a function to print the result to the page:
function prnContent() {
createContent();
document.getElementById("stuff").innerHTML = disp;
}
2) In your web page, load the page above in the <head> section, then
assign the spot where you want the code to appear and call the content
printing function last:
<head>
<script type="text/javascript" src="Content.js"></script>
<head>
<body>
[...]
<div id="stuff"></div>
[...]
<script type="text/javascript">prnContent()</script>
</body>
Now, when the user tries a "View Source", the most they'll see is the
container <div>, but not the actual content. Of course, if said user
is familiar with page construction and Javascript, it won't take long
to find where you hid it.
I too had a paranoid client and used the above to "hide" the content.
But be honest with the guy, and explain that while there is truely no
way to prevent content copying, at least this method, crude as it is,
will stop a lot of folks.
EW
4) Call prnThis() AFTER the page has loaded.
This is a