/    Sign up×
Community /Pin to ProfileBookmark

Page Automatic Redirect Exception

Hello all,

Using a function within a frameset environment that will prevent a user from direct typing a URL and have that page appear outside our frameset….

function pgLoaded() {
if(self.location==top.location) {
self.location=”http://mainpage.html“;

One of our pages requires a popup window to display our managment biography HTML pages (the last 3 letters of each filename is *bio.html), but when this popup window is activated, the redirect script brings the user back to “mainpage.html”

Is there a way to write an exception so the redirect will not effect these biography popups?? I tried some combinations of

if(self.loaction=’biography/*.bio.html)…

On our biography.html page, our code is as follows:
<a href=”mgt1.html” target=”popup” onClick=”biopopup(‘mgt1.html’, ‘popup’, 700, 300); return false;”>View Bio for Team 1</a>

Thanks for advice.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Jan 17.2007 — can't you just not put that code on that page?

You can do an index of on the url before you redirect for the page name

if(window.location.href.toLowerCase().indexOf("asdf") != -1)IHateSearchEnginesBringingPeopleToMySiteForInfoSoIDoThis();
Copy linkTweet thisAlerts:
@AndanteauthorJan 18.2007 — Thanks for the advice....

Temporarily, I removed the redirect routine from the affected biography pages.

If I understand correctly, I can replace the "asdf" argument with the absolute URL to test.

if(window.location.href.toLowerCase().indexOf("asdf") != -1)
Copy linkTweet thisAlerts:
@AndanteauthorJan 18.2007 — Thanks for the advice....

Temporarily, I removed the redirect routine from the affected biography pages.

If I understand correctly, I can replace the "asdf" argument with the absolute URL to test.

if(window.location.href.toLowerCase().indexOf("asdf") != -1)
Copy linkTweet thisAlerts:
@slaughtersJan 18.2007 — Hello all,

Using a function within a frameset environment that will prevent a user from direct typing a URL and have that page appear outside our frameset......[/QUOTE]
Sorry to but in, but I'd like to point out how irritating it is for a user to be re-directed in this way.

If I run across a link to one of your pages via a search engine I will be automatically directed away from the page I am interested in and sent to some generic front page which:

1) Will most likly *not* have the info I want on it.

and

2) Will not show me how to actually get to the page I am interested in.

I'll probably get frustated and just leave your site.

Instead of automatically re-directing to the front entry page, why not simply pass the url of the page they were trying to reach into your "mainpage.html" and use javascript to change the frameset values so the page of interest is loaded into one of the frames?
×

Success!

Help @Andante 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.8,
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,
)...