/    Sign up×
Community /Pin to ProfileBookmark

Detecting framesets on the client side

I’ve got a server that has no server side processing available (and I can’t add any support for it).

I have an HTML file that is normally suppose to load in an inline frame (please no replies on why I shouldn’t use iframes). I want to be able to detect if this frame is loaded within my frameset, and if it isn’t provide a link that would load the frameset around it.

First, can this be done w/o ANY server processing?
Secondly how could I do this?!?

Thanks in advance!!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryFeb 01.2004 — You could probably do something like this:
<script type="text/javascript">
if (self==top){
location = 'frameset.html';
}
</script>
Adam

P.S. Make sure your site is still accessible to users with JS disabled.
Copy linkTweet thisAlerts:
@ilbonparaurtiauthorFeb 01.2004 — This would forward the entire window contents to frameset.html. What I want to do is wrap a frameset that exists in another page around the current contents. I would use this script on multiple pages and do not wish to have an individual 'frameset' page for each and every document.

I doubt that this is possible to do but if anyone has any ideas on how this could be done I'd love to hear 'em.

I tried doing this w/ CSS but can't as I cannot mix the units of 'px' and '%'.
×

Success!

Help @ilbonparaurti 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.18,
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,
)...