[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

What is wrong with the codes

Using Internet Explorer 2.0 in Windows95, why folloowing
two codes may not work correctly?

1. nothing happended on the screen:

<HTML>
<HEAD>
<SCRIPT LANGUAGE=VBScript>
<!--
Sub window_onLoad
     window.Alert "Hello World"
End Sub
-->
</SCRIPT>
</HEAD>
</HTML>

2. only a text box, instead of a button:

<HTML>
<HEAD></HEAD>
<BODY>
<INPUT TYPE=button></INPUT>
</BODY>
</HTML>

0
victorlong
Asked:
victorlong
  • 4
  • 3
  • 2
  • +2
1 Solution
 
martinagCommented:
Are there still guys out there using IE2? :-)

1. No idea. I'm no good at VBScript
2. set TYPE to "TEXT"

Martin
0
 
martinagCommented:
And there must be <FORM></FORM> around the form elements.
<FORM>
<INPUT...>
</FORM>

Martin
0
 
martinagCommented:
Sorry, I misunderstood number 2.
What happens if you use this?
<FORM>
<INPUT TYPE="BUTTON">
</FORM>

Martin
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
victorlongAuthor Commented:
Hi martin,

>Are there still guys out there using IE2? :-)

Do you want to say that IE2 is too old? Need a new version for the Script? The IE2 comes with Windows95.
0
 
martinagCommented:
I thought that was IE3. Anyway, it's possible that your code will work in IE3 (add <FORM></FORM> and it'll work in Netscape too).

Martin
0
 
vendrigCommented:
victor: IE2 is real old, but it did ship with the first versions of Win95. As far as I recall, it does not support script. To make it official, this is in my browscap.ini:
[IE 2.0]
browser=IE
version=2.0
majorver=#2
minorver=#0
frames=FALSE
tables=TRUE
cookies=TRUE
backgroundsounds=TRUE
vbscript=FALSE
javascript=FALSE
javaapplets=FALSE
beta=False
Win16=False

So no script, hence the blank screen is correct.
0
 
MasseyMCommented:
1)  IE 2.0 does't supprot VBScript
2) There is no "button" type. It is either SUBMIT or RESET types.  Below will work.
<HTML>
<HEAD></HEAD>
<BODY>
<FORM INPUT NAME="Form" ACTION="" METHOD="POST">
<INPUT TYPE="SUBMIT"></INPUT>
</FORM>
</BODY>
</HTML>
0
 
victorlongAuthor Commented:
To MasseyM:

I found the "Button" type from a book! It is for click event in script.

To  vendrig:

Thank you for your comment....where is the ini file...I will try to find it in my computer.
0
 
vendrigCommented:
On my system it's in the ASP directory of my Personal Webserver. It's not something you need to have, it's just handy info. If you want to see it because you're interested in it, take a look at Browscap Central: http://www.cyscape.com/asp/browscap/
0
 
happy1Commented:
Hi, just a small corrections to 2 typos in proposed answer:

1. on the line - <FORM INPUT NAME="Form" ACTION...
The attribute "INPUT" is not valid for the tag name "FORM".
2. and on the next line: <INPUT> cannot have a closing tag.
Regards, Happy®One
0
 
MasseyMCommented:
Yes, you are right about #1 the INPUT is an error.  On #2, you can have a closing tags.  It is actually better HTML to close ALL tags, even the <IMG> tag.
0
 
happy1Commented:
On #2, you can have a closing tags.  
-----------------------------------
Hey MasseyM, do you want to invent "something"?:)

It is actually better HTML to close ALL tags, even the <IMG> tag.
-----------------------------------
Better for whom??:))
OK, before you'll post your references, here's mines.

*************
This document has been reviewed by W3C members and other
interested parties and has been endorsed by the Director as a W3C
Recommendation. It is a stable document and may be used as
reference material or cited as a normative reference from another
document.

And quote from the same page:
"INPUT elements are not containers and so the end tag is forbidden."
*************
URL for this document - http://www.w3.org/TR/REC-html32#input
Name - HTML 3.2 recommendation.

BTW in HTML 4 - same story: "Start tag: required, End tag: forbidden."
http://www.w3.org/TR/REC-html40/interact/forms.html#edef-INPUT

That's mean that your "better HTML": <INPUT TYPE=button></INPUT>
will generate error with some stoopid explanation:
Error: end tag for element INPUT which is not open; try removing the
end tag or check for improper nesting of elements.
Quote from http://www.htmlhelp.com/tools/validator/

Next - from your proposed solution:
There is no "button" type. It is either SUBMIT or RESET types. 
 
Hmm, actually there are 10 supported types of "input":
button; checkbox; file; hidden; image; password; radio; reset; submit
and text.
MS help with this here:
http://www.microsoft.com/workshop/author/dhtml/reference/objects/INPUT_button.asp
NS help - here: http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm

There's absolutely no any problem with this input.
Next quote from somewhere about "buttons", unfortunately I forgot
where that from, sorry:(

" This element seems to have slipped under the radar of most all other
the references I have seen, so finding info for it was difficult at best. I was
surprised to find that Netscape has supported this element since version
1.0. I am not sure what purpose it served in that era because its main
focus is now related to scripting (not supported until Navigator 2.0) I am
still looking for more info regarding this element.
 I made the VALUE a required element because neither browser has
a default button label (unlike submit and reset) - this makes the button
blank or almost non-existant if no VALUE is present."
 
I think that the only reason why Victorlong has problem with this
just because -
1st) he needs to put this input inside of the "forms" (Martinag's
suggestions) and
2nd) add there NAME and VALUE which are required for this input.

That's all, i.e. the more correct form for this will be:
<form ...>
<input TYPE="button" VALUE="Press Me" NAME="foo" onClick="test1">
</form>
Regards to all, Happy±One
0
 
victorlongAuthor Commented:
To  happy1:

Thank you very much for your long comment :-) It let me know more than I expected.

I have tried run my codes in IE4, that worked perfect.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now