pym59
09-25-2003, 05:49 AM
Is it possible to detect (capture ) click events in the same window. Example
I have a window with two frames:
1. a little frame at the top displaying anc counting the click in the window
2. a big one, the rest of the window, displaying webpages, which are not on the same server (for example www.altavista.com)
Is it possible to detect when the user click something in the frame containing the page www.altavista.com so that i can count the clicks in the upper frame.
I have no idea if it is possible and in which language this could be implemented
I have seen several examples, how to capture click event in a document, when i try to replace document with window, this dont work anymore
any ideas or is this exactly what it is not possible to do for security reasons
thanks
<SCRIPT LANGUAGE="JavaScript">
<!--
var flag = (window.Event)? true : false;
function documentHandler(e) {
if (flag) {
elem = e.target;
} else {
elem = window.event.srcElement;
}
alert('Element' + elem);
}
function clickHandler(e){
alert('Evenement transmis au niveau du bouton de formulaire.')
}
if (flag) {
document.captureEvents(Event.CLICK);
}
document.onclick = documentHandler;
// -->
</SCRIPT>
I have a window with two frames:
1. a little frame at the top displaying anc counting the click in the window
2. a big one, the rest of the window, displaying webpages, which are not on the same server (for example www.altavista.com)
Is it possible to detect when the user click something in the frame containing the page www.altavista.com so that i can count the clicks in the upper frame.
I have no idea if it is possible and in which language this could be implemented
I have seen several examples, how to capture click event in a document, when i try to replace document with window, this dont work anymore
any ideas or is this exactly what it is not possible to do for security reasons
thanks
<SCRIPT LANGUAGE="JavaScript">
<!--
var flag = (window.Event)? true : false;
function documentHandler(e) {
if (flag) {
elem = e.target;
} else {
elem = window.event.srcElement;
}
alert('Element' + elem);
}
function clickHandler(e){
alert('Evenement transmis au niveau du bouton de formulaire.')
}
if (flag) {
document.captureEvents(Event.CLICK);
}
document.onclick = documentHandler;
// -->
</SCRIPT>