/    Sign up×
Community /Pin to ProfileBookmark

Onclick within a frame?

Would it be possible to have javascript detect if anything is clicked within a frame window?

Such as this example:

Have a window open that is divided into 2 frames, a top and bottom. Would it be possible for the top frame to contain a script to know if anything has been clicked within the bottom frame’s contents?

or have a page open a new window and report back to the first page if anything has been clicked within the new window?

I am running a page exchange and would like to implement the feature of knowing if a member actually clicks on any links within the page that is being displayed.

Any thoughts are GREATLY appreciated.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoJan 20.2006 — yes, it is possible. If you want to know if a specific object has been clicked then that is easy. If you want to know if any object has been clicked then it is a bit more tricky. The code wont be done in the other frame though. The code will be triggered from within the frame that you click in though. NOt the other frame.
Copy linkTweet thisAlerts:
@NCA2authorJan 20.2006 — So how would I do this with a frame page such as this one below....



[code=php]
<html>

<head><title>Site</title></head>

<frameset rows="45,*" framespacing="0" border="0" frameborder="0">

<frame name="top" scrolling="no" noresize src="topframe.php">

<frame name="bottom" noresize SCROLLING="yes" src="http://www.SiteThatIWantToKnowIfClickedOn.com">

<noframes>
<body><p>This page uses frames and your browser does not support them.</p></body>
</noframes>

</frameset>

</html>
[/code]
Copy linkTweet thisAlerts:
@NCA2authorJan 21.2006 — anyone?
Copy linkTweet thisAlerts:
@konithomimoJan 21.2006 — It cannot be done for your bottom frame unless that page is on your server . . . meaning that it is one of your pages. If it is a page from another site/domain then you cannot do what you want to do.

Most people who ask this question are trying to force someone to click a link for a click to earn program such as mod-chip, which you cannot do with javascript.
×

Success!

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