Steph(an)

1Hi all.

I'm new to IE extension development and I'm trying to get a basic "hello world" extension together. I've hit a problem and would greatly appreciate your help.

I've followed the "Adding Toolbar Buttons" tutorial at http://msdn2.microsoft.com/en-us/library/aa753588.aspx

The button is showing up, but when I click it nothing happens. I'm not sure what the script language is meant to be - I assumed Javascript. I've created a file called test.htm and referenced it from the Script string in my extensions registry entry.

<html>
<head><title>Hello world</title></head>
<body>
<script type="text/javascript">
alert("Hello world");
</script>
</body>
</html>
1
I've also tried calling the file test.js and getting rid of the html markup, which makes no difference.

What language does Microsoft mean when they talk about scripts What have I done wrong I'm sure I'm missing something obvious.

Many thanks.

Steph

P.S. It's IE6 btw.


Re: Internet Explorer Extension Development Problem with "hello world" button

John Sudds - MSFT

Remove everything but the script tag. The file name shouldn't make any difference.

For example, the following script can generate a random GUID for your next extension:

<script type="text/javascript">
var TypeLib = new ActiveXObject("Scriptlet.TypeLib");
window.menuArguments.document.writeln(TypeLib.Guid);
</script>

(Special thanks to http://www.somacon.com/p113.php for the idea.)





Re: Internet Explorer Extension Development Problem with "hello world" button

Steph(an)

11Thanks for your reply.

I've got it working now. As I was in the process of forming a reply containing the registry entries, I found out the problem.

I was referencing the script using a string surrounded by double quotes, as follows:

Code Snippet

Script REG_SZ "c:\program files\iebuttontest\hello.js"


That didn't work. This did:

Code Snippet

Script REG_SZ c:\program files\iebuttontest\hello.js


Oddly, the icons were picked up fine when their location was surrounded with double quotes, but the script obviously wasn't.

I had a feeling it would be something obvious I'd done wrong!

Steph

1




Re: Internet Explorer Extension Development Problem with "hello world" button

John Sudds - MSFT

Good to know. Thanks!