/    Sign up×
Community /Pin to ProfileBookmark

Please help a Javascript novice! Important, for a client!

I am not experienced at writing Javascripts, only using them and I can occassionally edit one if its minor, but I have a need for a Javascript that I have not been able to find and hoping some kind person can help me out with locating one or writing one. It shouldn’t be anything too long. But what I need is a javascript that PREVENTS someone from bookmarking a page. I need it to give them an error, popup, redirect, whatever when someone tries to save or bookmark the page. I’m trying to prevent someone from using the “backdoor” so to speak to gain access to a page instead of going through the referring links. I can and will encrypt the page itself so they can’t just write the URL down, but I need it to not allow them to bookmark it either. Can anyone help? This is for a client site and I’m not sure what to tell them since I cant find a script. Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@chestertbOct 17.2003 — Hi,

One solution would be to write a little routine that looks for a cookie that is only created on the front door page. If the browser didn't find the cookie, you'd automatically flick them out of the page they've bookmarked and back to the front door.

It would look something like this...

In the page header...

<script language-"Javascript">

//check if cookie from the frontdoor exists

if(document.cookie == '') //which means there's no cookie

{

top.location = 'frontdoor.htm';

//which flicks them out of the page and back to the front door.

}

</script>

That will only work if either the site hasn't created cookies for anything else or the user has closed his/her browser between visiting the site and gaining access the first time, and using the bookmark to access subsequently. If either of these creates a problem, you could control access in a similar way, but via the data within the cookie, rather than just checking if the cookie exists.

Might not be the perfect solution but I hope that helps,

IB.
×

Success!

Help @wdu2003 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...