geekgeek@microsoft.com Download the code (3KB)
Robert Hess
GEEK You previously mentioned that to size input boxes you should use the string inside the value property. This is actually only half correct. I know that you focus on Microsoft® Internet Explorer, but a large portion of users still have Netscape browsers. Because the default fonts used in forms are different in Internet Explorer and Netscape Navigator, the spacing you specified between the two browsers is not identical. The cheap and dirty way around this is to employ Cascading Style Sheets (CSS) for Internet Explorer and change the font property to NewCourier 10 point for all INPUT attributes. Now you can use inside the value property and all buttons will be the same size.
GEEK I'm running Windows NT® 4.0 and IIS 3.0. When I try to run ASP files, Internet Explorer 3.02 tells me "Access Forbidden (Read Access DeniedThis virtual directory does not allow objects to be read)." The ASP files I am trying to execute are in a directory that has execute access but not read access. It's like IIS is trying to read the file when it should be executing it. Why is this? I looked at the file types option in the Control Panel and ASP is not listed as a file type. But if I type it in as a new file type, it tells me "The extension ASP is already in use by file type asp_auto_file. Choose another extension."
GEEK I have a page that incorporates VBScript. I want to use the same code on multiple pages, but I can't get it to work. Internet Explorer says that chcolor.style isn't supported. Why can't I have the same ID twice? Here's the code:
This is what I want to do:
GEEK You are attempting to give several different elements on your page the same ID. Based on your code, I suspect that you want to have one function that services the onmouseover event for multiple elements on the page. Figure 1 shows a much better way of accomplishing this.Note that this is not the only way to achieve what you were trying, just the one that is probably closest in structure to the sample code you sent me. You could also use what is known as event bubbling to do the same thing, which would be especially handy if you simply wanted all anchors on the page to have a mouseover effect. Figure 2 shows an example of what that code might look like. While this appears to have more code in it, note that the <script> block is written so that it is simply copied over into any file you want this behavior in, making other changes unnecessary.
GEEK How can I configure Personal Web Server so I can view and create ASP files? I downloaded ASP and installed it into the Scripts folder, then changed the permissions on the folder to read and execute scripts. But when I click on an ASP file, FrontPage® opens up. What am I doing wrong? GEEK I wrote a JavaScript version of your "select and go" dropdown list from the August 1997 issue of MIND. It works fine in Internet Explorer 4.0, but has problems in Navigator 3.x and Internet Explorer 3.x. |
|
GEEK You are having trouble because you didn't convert the code from VBScript to JavaScript properly. While Internet Explorer 4.0 is being nice by recognizing this value, and is attempting to reference the currently selected value of the <select> element, both Internet Explorer 3.x and Navigator 3.x are being a little more hardnosed about this. Both require you to specifically identify the value you want to access as an indexed offset into the full array of options contained in the select array. If you recall my original VBScript code, I got this value as follows: |
|
And so a correct translation of this to JavaScript would be: |
|
GEEK What is a good resource for do's and don'ts to achieve cross-browser compatibility?
|