/    Sign up×
Community /Pin to ProfileBookmark

location-property in frames

Hey,
Imagine: You have a page devided into frames. Now you would like to know the location of the site you’re viewing in one frame in the other.

Usually you could use the location property of document.

But it seems that this function is restricted or so when viewing a site outside your domain.

Anyone tricks for that?
Thanks.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisNov 02.2003 — No tricks. It is a security risk to allow client-side script to investigate information from a different domain.
Copy linkTweet thisAlerts:
@stimauthorNov 02.2003 — So what you're saying is that I can never know the adres my frame is viewing? Not even with another language. ?

No options like iframe of some?

None?

Damn (sorry)
Copy linkTweet thisAlerts:
@stimauthorNov 02.2003 — Also, can i not alter the url of the frame?

Say from any location i want a button that redirects it to google. This also doesn't work?
Copy linkTweet thisAlerts:
@gil_davisNov 02.2003 — I have never tried it. My understanding of the security rules leads me to believe that you should not be able to alter any property of a window or frame once it becomes "foreign" by loading a page from a different domain. You will be able to change the file that is in the window/frame using a html link with a target that specifies the name of the window/frame, but not with script.
×

Success!

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