Reply
IE cross-frame scripting with HTA's ?
Old 04-27-2006, 03:25 PM IE cross-frame scripting with HTA's ?
Junior Talker

Posts: 3
Location: Lancaster, PA
Does anyone here have experience doing cross-frame scripting using IE and .HTA files? I've been referring to http://support.microsoft.com/kb/q241754/ for help, but am not having any luck, and the example on the page doesn't even work. It gives me a "'window.external' is null or not an object" error when I click the "Add to Favorites" button.

The Support document says
When a user accesses the HTA, it asks whether he or she wants to "execute" the file. If the user says yes, the HTA opens in its own window. From that point on, documents can script freely across frames whose documents come from different domains.
Which is what's happening, but popping the frame performing the cross-frame action out of the frameset removes it from the document herarchy...and this is a strange definition of cross-frame scripting.

What I'm trying to do is create a local "shell" application that's launched from the user's hard drive and run over an existing HTML application on one of my company's web servers. Since the code doing the scripting is all local, I hadn't thought cross-frame scripting would be an issue at all. The Microsoft document is from a year-and-a-half ago, and I suppose it's possible some security patch changed things, or my company has locked something down. I've checked every configurable IE setting and don't see anything that might be causing the problem. I'm running XP Pro SP1, with IE6, and would appreciate any suggestions.

Thanks,

Todd
theTAO is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-03-2006, 04:04 PM Re: IE cross-frame scripting with HTA's ?
Junior Talker

Posts: 3
Location: Lancaster, PA
FYI, I figured this out eventually. The syntax is just very specific....although the web site example really doesn't work. Here are a few tips for anybody who finds this post in the future:

1) Framed HTA programs require one and only one .hta file, for the main <framset> or <iframe> file, with an <APPLICATION: HTA> at the start of the code. Use the application=yes attribute in your <frame> or <iframe> tags as often as needed.

2) WinXP (etc.) increased its scripting security in the "localhost" / "My Computer" environment around the time of Service Pack 2, although various individual Hotfixes or Security Updates can have the same effect. Here, we're not running SP2, but a mix of individual updates, so some user settings are mysteriously missing. (I don't use Windows at home, and was none the wiser until I found docs on the changes.) More info is available at http://www.phdcc.com/xpsp2.htm , including info on achieving similar results with an HTML "Mark of the Web".

3) I'm not 100% certain, but it seems best to place any code performing cross-frame actions in the <frameset> document itself, instead of in another frame, and then trying to reach "up and around" into the frame to be read or modified.

4) When traditional ways of accessing Javascript objects fails, always try the "DOM2" (or equivalent) methods, in this case "document.all". I found some useful examples in the "Web Rover" code at http://www.irt.org/articles/js191/index.htm .

Todd
theTAO is offline
Reply With Quote
View Public Profile
 
Old 05-03-2006, 11:56 PM Re: IE cross-frame scripting with HTA's ?
vangogh's Avatar
Post Impressionist

Posts: 8,356
Name: Steven Bradley
Location: Boulder, Colorado
Todd, sorry no one here was able to help, but glad you were able to figure it out on your own. Thanks for posting the solution too. I'm sure it will help someone with similar issues in the future.
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to IE cross-frame scripting with HTA's ?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16874 seconds with 13 queries