To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-21-2006, 01:53 PM   #1
nca
Senior Member
 
Join Date: Sep 2002
Posts: 122
Question Clicking within a frame

Would it be possible to have javascript detect if anything is clicked within a frame in a 2 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 I could have 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.


Here is my example frame window:

PHP Code:
<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>
nca is offline   Reply With Quote
Old 01-21-2006, 11:36 PM   #2
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
Possibly worth reading...
JavaScript - Introduction to Frames

And also:
How can I capture keypress events of frames to process them in the frameset ?

Last edited by bpat1434; 01-21-2006 at 11:50 PM.
bpat1434 is offline   Reply With Quote
Old 01-21-2006, 11:42 PM   #3
JPnyc
Administrator
 
Join Date: Jan 2005
Posts: 963
But it's so much easier to put it in the 2nd frame doc. Just set a flag and put it onclick of the body tag
__________________
PHP builder Online Community Manager

JPnyc is offline   Reply With Quote
Old 01-21-2006, 11:51 PM   #4
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
But if it's a remote file, it won't work by editing the page....
bpat1434 is offline   Reply With Quote
Old 01-22-2006, 08:33 AM   #5
madwormer2
Cardboard box 2.4
 
madwormer2's Avatar
 
Join Date: Apr 2005
Location: UK
Posts: 691
If it's a remote file you can't access it via javascript full stop.

Security reasons.
madwormer2 is offline   Reply With Quote
Old 01-22-2006, 03:56 PM   #6
JPnyc
Administrator
 
Join Date: Jan 2005
Posts: 963
You could use an iframe, put onclick="flag='true';" in the tag, then test for the value of 'flag'. Of course be sure you initialize flag=false; and that it's a global variable
__________________
PHP builder Online Community Manager

JPnyc is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:58 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.