views:

431

answers:

1

in

(void) webViewDidFinishLoad: (UIWebView*)webView

I inject some javascript to handle the iframes. e.g.

    stringByEvaluatingJavaScriptFromString: 
@"try {
    var document = window.document.getElementsByTagName('iframe')[0].contentWindow.document.getElementsByTagName('frame'); 
    } catch (e) {
    alert (e.message);
    }"

It tells me the iframes document is undefined. Actually I have tried to print all the properties of contentWindow of iframe, but it's totally empty.

I know the webViewDidFinishLoad may be called several times for each frame load. But I can never get the iframe document. I thought there should be at least once all the iframes are ready.

Could someone please tell me how to get the iframe document to process the dom in the uiwebview?

Thanks

A: 

Hi, Did you ever get an answer to this? I need to access the URL of the iframe...

mary