?
Solved

get selected image object in iframe

Posted on 2009-02-23
7
Medium Priority
?
983 Views
Last Modified: 2012-08-13
I want to acess a selected image object which is in iframe.
i am using this code alert(window.parent.frames[0].window.document.selection.type)
it displays control.But i want the selected image object.Iam trying below code.but iam unable to get the object.how can i get the selected image object
alert(window.parent.frames[0].window.document.selection.controlRange.item())
0
Comment
Question by:sastry_sagi
  • 3
  • 3
7 Comments
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 800 total points
ID: 23718985
How about just making the image clickable?

0
 

Author Comment

by:sastry_sagi
ID: 23720695
Hi expert,
      Iam also using onclick event for image in onclick event iam showing one div with some options if i click on one option a modalopopup is open.In this is scenario I want to access the select image object in that modal pop-up. if I alert this "window.parent.frames[0].window.document.selection.type"  message iam getting control. But I want to access  object.How can I get access to the image object??
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 800 total points
ID: 23720838
sounds a bit much.


Perhaps

window.parent.frames[0].window.document.selection.createRange().parentElement().document.getElementsByTagName('img')[0]


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:sastry_sagi
ID: 23781864
the solution is not working for me.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 23781935
then I have no more suggestions
0
 

Accepted Solution

by:
sastry_sagi earned 0 total points
ID: 23782154
the main problem is i am having 3 to 4 images in the iframe with same ID. i changed the code to give the ID's dynamically. i will test the above solution with my new code and i will update you.,
0
 

Expert Comment

by:santosh_cdac
ID: 36966621
Even i want solution for this question.
Any help appreciated.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question