What I have is an iframe displaying a web page for a sensor that hosts it's own webpage showing humidity and temperature. All I really need is the current temperature and humidity so that I can display it on a main page displaying lab status. So from what I gather I need to reach into the iframe, that way I can get to the tr/td values for the table being used to hold what I need.
From scouring the internet top to bottom I put together the following code...
var myIFrame = document.getElementById('ifOmega');
var content = myIFrame.contentWindow.document.body.innerHTML;
The problem is that the second line silently fails. I tested myIframe to ensure that it executed and was not null. I am using Visual Studios 2010 and so I am not sure if maybe it's a limitation there? I only say that because when I try to type...
var content = myIFrame.
...the intellisense doesn't pop up with contentWindow as an option.
Even when I figure this out I'm not sure how to dig deeper other than.
var var0 = content.getElementById('rd0');
Where rd0 is the name/id of the cell that has a div inside containing the temperature value. I am assuming to reach into the I will need one of the javascript sibling/child methods?
BTW, my javascript is executed client side with...
Sys.Application.add_load(getTempTable);
..at the top.
Thank you for any help.