DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   How To Implement This Code? (http://www.daniweb.com/forums/thread114981.html)

Inny Mar 20th, 2008 10:19 pm
How To Implement This Code?
 
I want to use this code to display a blank page When someone clicks 'veiw source' from either the context menu or toolbar. (if they switch off javascript they are simply redirected, I use another code)
I dont want extra pages popping up, Just the blank page, possibley I could Add an Image aswell?

Not sure how to implement this code, its a bit confusing. I need to know How and where to put bits. If I put it 'as is' in my header, it loops indefinately.

[inline code]
<html>
<head>
<SCRIPT>
<!--
/**************************************************
Speed Code Seal v1.5
Created by Howard Chen
Provided & Modified By http://www.DesignerWiz.com
Your Free Complete Web Development Resource Center
Get more JavaScripts at http://start.at/javascripts/
Bugs report to jdeveloper@telebot.net
This script is free as long as the credits above are kept
**************************************************/
//== BROWSER COPY THE CODE BELOW==
code="<H2><b>Access Denied</a></b></H2>"
//== BROWSER COPYING STOP HERE ==
//== Code Present ==
//== If Present ==
codeabove=""
n = (document.layers) ? 1:0;function init() { if (n) {document.layers['display'].document.open();document.layers['display'].document.write(unescape(code));document.layers['display'].document.close();}if (!n) document.write(unescape(code));
}//-->
</script>
<title>RESTRICTED AREA: YOU ARE BEING TRANSPORTED</title>
</head>
<BODY bgcolor="#ffffff" text="#ffffff" onLoad='init()' onunload ="document.open('code_seal_v1.5_1.htm','','halfscreen,scrollbars')" <!--www.DesignerWiz.com-- -->
<SCRIPT><!--
if (n) document.write("<DIV ID='display' STYLE='position:absolute; top:0; left:0; width:800; height:600'></DIV>")
//-->
</script></script></body></html>[/inline code]

ExplainThat Mar 21st, 2008 9:43 am
Re: How To Implement This Code?
 
I think the right answer here is - don't bother. Wanting to hide CSS, HTML and JavaScript is
  1. difficult if not impossible
  2. quite against the spirit of the web - at one time or another we have all benefited from looking at other peoples' code so you shouldn't complain when it is payback time

Sure there are times when you want to keep all and sundry from knowing how you do certain things. When that is the case consider doing one of the following
  • Use server-side logic do to all that is needed.
  • Use the XMLHTTPRequest object along with the JavaScript eval function to have the code downloaded and executed on the fly. This does not "protect" it but does make it a lot less accessible.

Inny Mar 21st, 2008 10:05 am
Re: How To Implement This Code?
 
Ok thanks For that, I just wanted to make it 'not worth the effort' for certain cut N pasters to continue ripping content for a rival site.
I use Ondrag/onselect return false, but they know how to veiw source.
This is evidenced by the copied content on their site full of markup like '<br>' and <p> .
Its just annoying really. I could unescape scramble it but its a pain to me as I have to unscramble to edit coding.

Thanks for the Reply mate.

ExplainThat Mar 21st, 2008 2:06 pm
Re: How To Implement This Code?
 
A very simple obfuscation may make it not worth the effort for the magpie types - try this

http://javascriptcompressor.com/

It is a freebie.

Inny Mar 21st, 2008 9:41 pm
Re: How To Implement This Code?
 
Thanks again mate!


All times are GMT -4. The time now is 4:00 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC