Javascript, ActiveX and IFrames
Been working on a project that involves getting some JS to interact with an ActiveX control and then have that work with an IFrame for asynchronous uploading. It’s been interesting, at least. Getting the AX object into the page so that my JS could actually reference its methods was the first hurdle. After a day of banging my head against the wall I stumbled onto a site that recommended using innerHTML to write it out. Wonder of wonders, it worked great.
I started building up the JS scaffolding around that and promptly ran into another issue. While the ActiveX object is thinking it calls a predetermined callback method in the JS to give status updates. Unfortunately, you can’t declare this callback until the object is in the page. This means dynamically inserting a new JS file in the initialization after dynamically inserting the ActiveX object. That’s a lot of dynamic inserting and it makes me a bit nervous but it works fine in IE and since we’re using ActiveX that’s all I have to test!
The next step is getting asynchronous uploading using an IFrame working. This is being complicated by most tutorials that cover this technique being old as dirt. We’re talking 2002 old as dirt here, before AJAX was anything more than a cleaning product. “Script Remoting” is not what I want to do (I have XMLHTTPRequest for that, thank god) but that’s what most of these tutorial focus on. It makes parsing out the useful info needlessly complex and it’s really driving me up the wall.
Having a a good time at JumpCut though.
July 13th, 2007 Comments Off



