473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Detecting clicks in frames....

manuelgk
Hello everybody!!, as you see I have been trying the "urls-click detector" in my example pages and in other pages of the Web. Yesterday, I downloaded the JDK and as you know it has its own tutorial Web page so I tried to put my script into this page but it had no effect!! :S. The index page calls other pages with frames. My question: is it possible to detect a click into the frames?
Here is my script code, I already change (for people who had seen this before) some lines:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.       window.onload=function() {
  4.               els=document.body.getElementsByTagName('*');
  5.                 for(c=0;c<els.length;c++){
  6.                   els[c].onclick=function(){
  7.                    getOnclicks(this);
  8.                   }
  9.                  }
  10.          }
  11.  
  12.              function getOnclicks(el) {
  13.              cadena=new String("?COLAB_CLICK=YES");
  14.              var url=String(el.getAttribute('href'));
  15.              if (el.tagName=="A"){
  16.                  el.href=el.href + cadena;
  17.                  }
  18.  
  19.              }
  20.  
  21.      </script>
Thanks everybody
Oct 9 '07 #1
3 1075
iam_clint
1,208 Expert 1GB
You will need to loop through document.frames
Oct 9 '07 #2
[Ok so, what I need to is something like a condition to take the document's frames and the href if I I want to conserve my original code right?.
Kind regards
Oct 11 '07 #3
Hi everyone,
I tried to make what you told me to do, however when I changed the line "document.body" with the line "document.frames" it did not work as I expected :S. My conclusions for this problem are:
-> Web pages containing frames calls other pages from somewhere else
-> Some of these Web pages act like an "Index" where the other pages are including (Pages with frames).
-> For this 2 reasons, with my code I can not access the clicks into the pages contained inside the frames, so I put my script into the loaded pages in the frames and it works well allways with hyperlinks which go to another Web page and not into the same page (weird!!!:S).

I do not know if it is true or if there is a way to adapt my code to detect the clicks in frames, and knowing into which frame should the page be presented (that is, which is the "target" frame).
I hope you can give me better advices for this problem.
Thanks a lot!!!
Oct 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var...
1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
3
by: foldface | last post by:
Hi Given a web page using frames, is there anyway the left frame can request a page in the right frame and, most importantly, detect when it has fully loaded? Ideally this requires no changes to...
2
by: Kiran | last post by:
Hi all, Can anybody let me know how to detect when my user clicks the X button on the window. I used unload event it did not work(on IE). My web page is a .asp page which reloads itself when...
2
by: Sam-Kiwi | last post by:
I've spent the last 6 months developing a pay-per-download website using ASP.NET Users purchase documents and then download them. The intention is that users are only charged for documents...
0
by: Frank Rizzo | last post by:
Not sure if this is the right place to ask this question, but here it goes... Is it possible to write an add-in that detects mouse clicks in the IDE, particularly mouse wheel clicks? Thanks.
25
manuelgk
by: manuelgk | last post by:
Hi! how can I detect the frames in a web page with Javascript? I mean, I want to detect the frames and set an alert with all frames contain in a Web page. Thanks again!!!
3
jhardman
by: jhardman | last post by:
I have an old site built with frames, and I plan to leave it in frames for now. The problem is that occasionally I find links (from outside) lead me to just the content frame which means most of the...
1
by: \(O\)enone | last post by:
I've added a TabControl to my WinForms app, and added a couple of tabs to the control. The result is that the top strip of the TabControl contains the two tabs, and then to the right of them is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.