Click to See Complete Forum and Search --> : Javescript To Prevent People From Copying My Ads Or Website


blazin6543
12-04-2002, 12:47 PM
PLEASE HELP!
i need a javascript to prevent users from copying my ads on ebay or copying some parts of my website. can some1 please help me? email me or leave msg on here, doesnt matter. i really need it asap :(

Ryan
12-04-2002, 03:38 PM
it's not possible to prevent someone from duplicating your page/ads, no matter what you try to do.

blazin6543
12-05-2002, 09:36 AM
i have a javacode and prevents that but when i try to edit the code, it doesnt work anymore. <SCRIPT>function click() {if (event.button==2) {alert('Your Warning Message Line 1 here\nYour Warning Message Line 2 here\nYour Warning Message Line 3 here\nYour Warning Message Line 4 here');}}document.onmousedown=click// - -></SCRIPT> also in ebay when u try to copy sum text from some ads it wont let u. so there is a way

Rodders
12-05-2002, 10:17 AM
<SCRIPT>function click() {if (event.button==2) {alert('Your Warning Message Line 1 here\nYour Warning Message Line 2 here\nYour Warning Message Line 3 here\nYour Warning Message Line 4 here');}}document.onmousedown=click// - -></SCRIPT>

Switch off javascript on your browser then try that little bit of code in your page again. It won't work.

Even with javascript on, you could probably cache the HTML page and then open it in Notepad to see your code.

If you don't want a user to see your code, then the only fail-safe way is to not send it to them. Of course, that's no good f you want people to view your website.

In short, you have to trust people.

Vladdy
12-05-2002, 11:28 AM
Other ways to get the source code:
- type in the address bar: view-source:http://www.easyreviews.com/
- never failing Save As...

samnewberry
12-05-2002, 02:37 PM
I've often disabled the user from using their VIEW SOURCE with a Right-Click. This helps to stop the curious newbies or the people trying to steal code or anything else. Bottom line is you can only make it a little harder for them.

If someone is really digging they will know how to look at their own cached files and see the source code. That is the nature of JavaScript. It runs on the client side therefore it must be sent to their computer and browser!!

AdamGundry
12-05-2002, 02:39 PM
This won't fully protect your code, but you can add a (very) basic level of security, preventing right clicks using the following:

<body oncontextmenu="return false;">

As noted before, you can get round it easily, and some browsers don't support it. This will stop the casual copier, but nothing more. It does have the advantage of not displaying an annoying message box.

Rodders is quite right - anything you put in a HTML document accessible by someone is visible if you know how. It has to be, or how could the user's browser understand the page?

Adam

samnewberry
12-05-2002, 03:44 PM
You could use a Macromedia Flash plugin animation to present your content. The files are compiled SWF format and the ActionScript (similar to JavaScript) code created by Flash won't be accessible to your visitors via "view source." You can also set a control on the SWF so you can't decompile the files, I believe.

Vladdy
12-05-2002, 04:53 PM
Originally posted by samnewberry
You could use a Macromedia Flash plugin animation to present your content. The files are compiled SWF format and the ActionScript (similar to JavaScript) code created by Flash won't be accessible to your visitors via "view source." You can also set a control on the SWF so you can't decompile the files, I believe.
And thus make site unaccessible for those without flash plug-in.

Da Warriah
12-05-2002, 08:03 PM
ive seen some sites where the View Source is grayed out, both on the right-click menu, and in the View drop-down menu at the top...anyone know how to do this??

mr foo
12-06-2002, 03:35 AM
Originally posted by samnewberry
You could use a Macromedia Flash plugin animation to present your content. The files are compiled SWF format and the ActionScript (similar to JavaScript) code created by Flash won't be accessible to your visitors via "view source." You can also set a control on the SWF so you can't decompile the files, I believe.

there are de-compilers for .swf now