script problem

liunx

Guest
Hello,<br />
<br />
I have a problem with the script that redirects visitors to a page if they haven't came from a "required" specific page. When I test the scripts it redirects me, BUT always also if i came from the right page. If you have no idea what script I am talking about look at: <br />
<br />
<!-- m --><a class="postlink" href="http://javascript.internet.com/user-details/must-visit-from.html">http://javascript.internet.com/user-det ... -from.html</a><!-- m --><br />
<br />
Can you help me out, THX!<!--content-->1) this should be in the javascript forum.<br />
2) you need to show us your source code - you may have implemented the script wrongly.<!--content-->Ok, here is how i've implemented the script. It's only the part between the head ection but i gave some extra lines in case there's something wrong about those lines...<br />
----------------------------------------------------------------------<br />
<br />
<html><br />
<body topmargin="20" bottommargin="10" leftmargin="0" rightmargin="0"><br />
<div align="center"><br />
<br />
<br />
<br />
<HEAD><br />
<!-- This script and many more are available free online at --><br />
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> --><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
var requiredfrom = "warning.html"; // required prev. page<br />
if (document.referrer.indexOf(requiredfrom) == -1) {<br />
alert("You must come to this page from " + requiredfrom);<br />
window.location=requiredfrom;<br />
}<br />
</SCRIPT><br />
</HEAD><br />
<br />
<br />
<SCRIPT language="javascript"><br />
function click()<br />
{<br />
if (event.button==2)<br />
{ alert('Site Protected By Saiyan Elite')<br />
}<br />
}<br />
document.onmousedown=click<br />
</SCRIPT><br />
<br />
<br />
<table width="50%" border="0" align="center"><br />
<tr> ETC....<!--content-->Why is there a body tag above your head section?<!--content-->i have it like that in all my pages, not a big deal really because i tried to put it below the head section and i still have the same problem with the script...<!--content-->4 things:<br />
<br />
  1. <br />
    It appears that the code should work<br />
    Are you placing this on the warning.html page (wrong) or other page (right)?<br />
    Maybe the no-right-click script is causing a problem, as many threads have argued :)<br />
    The language attribute has become "deprecated." For best support, use:<script type="text/javascript" language="JavaScript">Note that the color need not be included <br />
    [/list=1];)<!--content-->
 
Back
Top