Solved

What is wrong with the codes

Posted on 1999-01-02
13
144 Views
Last Modified: 2010-04-09
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
Comment
Question by:victorlong
  • 4
  • 3
  • 2
  • +2
13 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1841175
Are there still guys out there using IE2? :-)

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

Martin
0
 
LVL 4

Expert Comment

by:martinag
ID: 1841176
And there must be <FORM></FORM> around the form elements.
<FORM>
<INPUT...>
</FORM>

Martin
0
 
LVL 4

Expert Comment

by:martinag
ID: 1841177
Sorry, I misunderstood number 2.
What happens if you use this?
<FORM>
<INPUT TYPE="BUTTON">
</FORM>

Martin
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:victorlong
ID: 1841178
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
 
LVL 4

Expert Comment

by:martinag
ID: 1841179
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
 
LVL 2

Expert Comment

by:vendrig
ID: 1841180
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
 
LVL 10

Accepted Solution

by:
MasseyM earned 50 total points
ID: 1841181
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
 

Author Comment

by:victorlong
ID: 1841182
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
 
LVL 2

Expert Comment

by:vendrig
ID: 1841183
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
 
LVL 2

Expert Comment

by:happy1
ID: 1841184
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
 
LVL 10

Expert Comment

by:MasseyM
ID: 1841185
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
 
LVL 2

Expert Comment

by:happy1
ID: 1841186
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
 

Author Comment

by:victorlong
ID: 1841187
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question