Solved

Javascript to read table data in a Page Viewer Webpart

Posted on 2011-09-09
4
242 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
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…

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now