Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames & Javascript

Status
Not open for further replies.

meishern

Technical User
Jan 16, 2004
2
TH
Hi,

I am interested in building this but am not sure if it can be done since i never seen this before.

User goes to your website (MYSITE.COM). It has 2 frames: TTOP & BBOTOM. TTOP has a counter set at 0. BBOTOM has a link. Link is outside MYSITE.COM (and not affiliated with me in any way). User clicks on link and goes to Yahoo.com (for example). Yahoo.com gets loaded up in the BBOTOM and is inside the frameset. User sees Yahoo loaded in BBOTOM and TTOP still showing counter at 0.

Now, Each time user clicks a link inside yahoo, i want the TTOP counter to increment by 1. So the further he browses, and even leaves yahoo.com to go to a new site (only by clicking links obviously), the counter will continue to increment.

Since the user is still inside the MYSITE.com frameset this should be possible somehow i believe for the parent to know if the child changes.

Is this possible, and any suggestion how to do this?

Thanks

Nick
 
i'm pretty sure it's not possible, since javascript will not allow access to a window outside of your domain, so you won't be able to keep track of the clicks.


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
I agree. I believe this falls under the realm of cross-domain scripting which is a security issue and simply not allowed.

Also remember, some sites do not like being caught in someone elses frameset. Authors of such sites implement 'frame-busting' scripts to ensure this does not happen. Obviously, this will negate whatever it is you're trying to do.

Since you are loading a page into your frame, you might be able to determine if a particular event (mouseclick) occurred and count that. But I'm unsure if you can capture an event on someone elses page, even if it is loaded into your frameset. Again, I would consider this a cross domain scripting issue.

Another potential option is to access the history object and determine the length of the history object starting from the point your frameset loaded. But even this is loaded with a number of problems, especially for framesets. Even if you access history, you still may not be able to accomplish exactly what you are trying to do.

RKM
 
I understand that there is no way to know if someone clicks on a link in someone elses website. However since this website IS inside MY framset, is my frameset aware that there is a change or reload that occurs in the BBotom frame?

Thats all i am trying to capture.

To clarify it even more:

I am sending users to specific pages on websites that are not on my domain. These pages each have only 1 link on them. I want to verify 100% that the link was clicked. I can not add any code to those pages though.

Thanks for your help so far.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top