ExecuteJavaScript into iFrame

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

ExecuteJavaScript into iFrame

Postby amitkanfer » Wed Jul 23, 2014 2:06 am

Hello,

i'm trying to access DOM elements in an iFrame and manipulate the elements in it.
so what i do is to use ExecuteJavaScript when the OnLoadStart / OnLoadEnd events occur.
Now, it seems that the javascript is indeed executed, hence is if i execute "alert" - i will see it on screen,
but the DOM elements still doesn't exist, so when i look for them in the script - i'm getting nulls.
I also tried using a timer, but still - no HTML elements.

If i run the same script on the main frame - it works great. this problem is only with iFrames.

any idea why this is happening? how can i overcome it?

thanks,
Amit
amitkanfer
Techie
 
Posts: 31
Joined: Mon Jul 21, 2014 4:10 am

Re: ExecuteJavaScript into iFrame

Postby magreenblatt » Tue Jul 29, 2014 9:46 am

If you control the content you can use the window.onload event to trigger JS when the frame content has loaded.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 74 guests