• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Capture Click inside frame in frameset using javascript

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp which contains a frameset and frames inside in it now i want to capture any click which s made inside the frames.

My Jsp:


iam looking for some java script so that if user clicks on anything inside the iframe(here i need click from frame with id mypage) i need to fire a method.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using framesets and frames? The are obsolete and removed from HTML5. You should be using either modern CSS blocks, or at best, iframes.

One of the problems with frames (which continues with iframes) is that each frame is its own document with its own DOM. Treating it all like a single page for the purposes of event handling is not going to happen and you'll need lots of custom (and necessarily messy) code to tie things together.

What are you trying to accomplish with all the frames? You should be looking into more modern ways to accomplish it.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a bit more: from the HTML5 specification on obsolete elements (which includes frameset, frame, and no frames):

The elements in this section are not to be used by Web developers.

 
deekshith deva
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, this is not the code which i have developed now it was developed some long time ago and iam in to defect fixing in this code i have no option to change it but to work only with the existing one.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case, my condolences.

You might be interested in this article that describes how to communicate between child and parent windows.
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic