views:

104

answers:

2

Need some help from javascript gurus.

I have one page where http://www.google.com/finance/converter is embedded inside IFrame. I am able to get the event notification whenever Google Finance page loads. Now problem is this that contents of this page is not accessible through javascript. It seems to be some security issue (firebug notified). Is there any workaround so that I can access values (result and select boxes) using javascript?

I am using ..

function iframe_loaded(){
  $("#frame").contents().find("select");  // returns 0 elements
}

+1  A: 

No there isn't. Imagine the security implications of this. A hacker site includes an iframe of your bank site and registers a keyup event handler for the input field where you type your credit card number capturing everything you type there.

Darin Dimitrov
A: 

Cross-domain communication with iframes is greatly restricted for security reasons. There is a hack that allows communication between the frame and the containing page (details here), but you have to have access to both pages, which isn't true in your case. Perhaps you would be better off building your own currency converter directly into your page, possibly using the Google Finance API.

Tim Goodman