Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Specify Referring Page In JavaScript
SUBMITTED BY:
Guest
DATE:
June 12, 2013, 1:24 a.m.
FORMAT:
JavaScript
SIZE:
451 Bytes
Raw
Download
Tweet
HITS:
1536
Go to comments
Report
<!--
source
:
http
:
//www.apphp.com/index.php?snippet=javascript-specify-referring-page -->
<
script
type
=
"text/javascript"
>
var
allowed_referrer
=
"http://www.yourdomain.com/referring_page_name.html"
;
if
(
document
.
referrer
.
indexOf
(
allowed_referrer
)
==
-
1
){
alert
(
"You can access this page only from "
+
allowed_referrer
);
window
.
location
=
allowed_referrer
;
}
<
/script>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus