Solved

Javascript to read table data in a Page Viewer Webpart

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

708 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

13 Experts available now in Live!

Get 1:1 Help Now