Solved

Javascript to read table data in a Page Viewer Webpart

Posted on 2011-09-09
4
243 Views
Last Modified: 2012-05-12
Using Sharepoint 2010.. Have a webpage being displayed using the Page Viewer Webpart.  Within the page is a table with data which is what I am trying to read.  i have a simple javascipt which sees the IFrame container but no data within it.    Need help..help,..help....

The javascript file is located in another list which I pull using the CEWP on the same page.  

Thanks.

0
Comment
Question by:TechMonster
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:chapmanjw
ID: 36514858
If the page in the iframe is on the same domain name (site) as the parent page, you can use some jQuery to interact with the contents of the iframe page.  See this article for an example: http://simple.procoding.net/2008/03/21/how-to-access-iframe-in-jquery/

 $('#iframeID').contents().find('#someID').html();

Open in new window


If the iframe page is on a different domain than the parent page, you will run into cross-site scripting issues and will be blocked by most browsers.
0
 

Author Comment

by:TechMonster
ID: 36515984
THe page is on a different domain.  Is there any solution for it?
0
 
LVL 21

Accepted Solution

by:
chapmanjw earned 500 total points
ID: 36516444
You can proxy the other site on your site. I have a sample here http://www.sharepointjohn.com/aspnet-proxy-page-cross-domain-requests-from-ajax-and-javascript/
0
 

Author Closing Comment

by:TechMonster
ID: 36709739
Though the Proxy solution will work I was hoping for a easier solution using Javascript or other language to read off the screen.  I do not have access to the other server the data is coming from.  As of today I have not found a solution which will work for me.  

Thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
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.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

831 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