Solved

What is wrong with the codes

Posted on 1999-01-02
13
140 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now