If debugging tools are installed on your computer, you may receive an error message that is similar to the following:
Note The following methods are based on the sample that is mentioned in the "More Information" section of this article. Therefore, the code and the file names in these methods may differ from your code and from your file names.
- Hard code a proxy server in the Proxy server settings of Internet Explorer instead of using an automatic configuration script, and then press F5 to refresh the HTA in the browser.
- Use a host name instead of a Fully Qualified Domain Name (FQDN) to access the path to the HTA.
- Use an IP address to access the HTA.
- Add the Web site that you are accessing to the Trusted zone or to the Restricted zone.
- Do not use the Location object in your code.
- Click to clear the Include all sites that bypass the proxy server check box in the Security settings of Internet Explorer.
Steps to reproduce the behavior
- Start Internet Explorer.
- On the Tools menu, click Internet Options.
- On the Connections tab, click LAN Settings.
- In the Local Area Network (LAN) settingsdialog box, click to select the Use automatic configuration script check box. Make sure that none of the other check boxes is selected.
- In the Address box, type the path to the automatic configuration script.
- Use Notepad to create a text file that is named Default.hta.
- Add the following HTML code to the Default.hta file:
<title>HTA Location.href bug reproduction</title>
<HTA:APPLICATION ID="oBugRepro" APPLICATIONNAME="BugRepro">
strLocation = top.fraTabs.location.href;
<frameset id="fstWorkAreaMain" name="fstWorkAreaMain" rows="40%,60%">
<frame src="about:blank" id="fraTabs" name="fraTabs" APPLICATION="yes">
<frame src="Main.htm" id="fraMain" NAME="fraMain" APPLICATION="yes">
- Use Notepad to create a text file that is named Main.htm.
- Add the following HTML code to the Main.htm file:
<input id="cmdButton" type="button" onclick="top.ShowFrame()" value="Click me to reproduce the behavior"></input>
- Place the two files, Default.hta and Main.htm, in a virtual directory that is named HTARepro on a Web server.
- Make sure that you have enabled anonymous access to the contents of the HTARepro virtual directory.
- Type the following command at a command prompt:mshta.exe http://WebServer/HTARepro/Default.htaNote Replace WebServer with the FQDN of the Web server that you are using.
- On the HTA application, click Click me to reproduce the behavior. You receive one of the error messages that are mentioned in the "Symptoms" section of this article.
ID do Artigo: 816885 - Última Revisão: 22 de set de 2011 - Revisão: 1