Getting Started
-
20. prosince 2006 23:24
Hi,
I have been looking around sites to see how to program extensions and such, but I am not actually making one as of yet--I am just researching it so that I can prepare to make one.
I just have one question if anybody wants to help me out. It would be greatly appreciated!
Q: How does the Internet Explorer Add-on communicate with the web page? For instance, can it act like a normal web page in that it can perform AJAX within itself, and get the response back from the server whenever it is returned? Or can an add-on even be dynamic?
Any help would be very much appreciated! My view is very wide at this point, so any information would be helpful. I know the some of the technical side, except for this, and that is mostly what I am interested in--the communication aspect between the add-on and the server/web-page.
I am hoping that it can do something like (in javascript notation):
function ajaxResponse(response){
document.getElementById(response['element_to_alter']).innerHTML = response['element_html'];
}
Thanks,
Tim
Všechny reakce
-
21. prosince 2006 5:05
IE uses OLE siting mechanism to communicate to the addon regarding the container (BHO use IObjectWithSite, ActiveX use IOleObject). An addon (BHO/ActiveX) can get the webbrowser COM object in which they are hosted (IWebBrowser2) and from this object you can access the IHTMLDocument interface which corresponds to the document object in jscript. MSHTML exposes several IHTMLXXXX interfaces which closely correspond to the DOM and you can perform most of the DOM operations from the addon also.
Some links which would be useful -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/cols/dnexpie/expie_hello_bho.asp
http://msdn.microsoft.com/library/default.asp?url=/workshop/components/activex/activex_node_entry.aspHTH,
Sharath -
21. prosince 2006 20:18
Thanks!
I actually had the first link bookmarked, but haven't had a chance to try it out. I just got Visual C++ yesterday.