🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.javascript
5 messages
5 total messages Started by John Dockery Tue, 06 Aug 1996 00:00
JavaScript, Beta Version & O'Reilly's Early Adopter Program for Online Books
#50
Author: John Dockery
Date: Tue, 06 Aug 1996 00:00
68 lines
4529 bytes
             
JavaScript: The Definitive Guide, Beta Version and O'Reilly's Early 
Adopter Program for Online Books


O'Reilly's Early Adopter Program for Online Books

O'Reilly has launched its Early Adopter Program, online books
for readers who want early access to upcoming titles.  Program
members will have access to drafts over the World Wide Web.  Some
drafts will be featured in their entirety; others chapter by chapter
as they're written.  You'll be able to access drafts on technologies
that are giving you information pain - software on the cutting edge.

To participate in the early adopter program, you pay the
same price as you would to purchase the finished book.  When you
sign up and make payment online, two things happen:

1.  You receive a user id and password to access the draft online

2.  Your printed book will be shipped to you as soon as it is 
    available (typically six to eight weeks later).

In short, for the price of the printed book, you get both
early access, and the book delivered to your door as soon
as it's ready.  For more information on the O'Reilly Early Adopters
program book at http://www.ora.com/publishing/early.html  The first 
book to be published this format is:


JavaScript: the Definitive Guide, Beta Version

This book is now online. It's a good example of the kind of
book we're talking about. JavaScript is a simple programming language
from Netscape that can be embedded in your HTML Web pages. It allows
you to control the behavior of the Web browser, add dynamically
created text to your Web pages, interact with the user through HTML forms
(without CGI scripts), and, in version 3.0 of Netscape Navigator, even
control and interact with Java applets and Navigator plugins.

We've printed this book in a "beta" edition because JavaScript is
still in beta, and is rapidly evolving.  Within Netscape, the version of
JavaScript that will be in Navigator 3.0 is being called "JavaScript
1.0".  This is an implicit admission that JavaScript as implemented in

Navigator 2.0 was still a beta version of the language.

Despite JavaScript's beta status, a tremendous number of people are
using it and need quality documentation for it.  At the same time,
however, we realize there have been a lot of changes to JavaScript
since Navigator 2.0 was released.  As this book is being written,
Navigator is at the 3.0b4 stage, and we are beginning to hear about
the new features that will be available in the 3.0b5 release.  It seems,
in fact, that JavaScript is changing faster at this point than at any
other time in its development.  Since we intend for this book to be a
definitive guide for the Navigator 2.0 and Navigator 3.0
versions of JavaScript, we are not ready to release the first edition
of the book until Navigator 3.0 is released in final form.  More
information on this title and how it can be ordered can be found at
http://www.ora.com/catalog/jscriptbeta/desc.html

-- 
John Dockery    

O'Reilly & Associates, Inc.  90 Sherman Street, Cambridge, MA 02140

617-354-5800     john@ora.com         Fax:  617-611-1116
Re: Please tell my why this won't work.
#46
Author: Aaron Peterson
Date: Thu, 08 Aug 1996 00:00
73 lines
2957 bytes
The Error:

JavaScript Error: file:/C|WINDOWS/Desktop/otog5.htm, line 7:
Window.Document.Form.text1 has no property named 'value'.

The HTML and SCRIPT and FORM:

<html>
<head>
<script language="JavaScript">
<!-- Hide

function test1(form) {
  if (form.text1.value == "")
    alert("Please enter a string!")
  else { 
   if (form.text1.value == "INCOR")
     parent.location.href="http://www.prostar.com/web/alpine/incor/";
  else {
   if (form.text1.value == "ALPine")
    
parent.location.href="http://www.prostar.com/web/alpine/welcome.htm";}
   }
}


// -->
</script>
</head>

<body>
<form name="first" method="post">
THE ORGANIZATION YOU WANT TO GOTO IS<br>
<select name="test1">
	<option selected value="ALPine">ALPine
	<option value="INCOR">INCOR
</select>
<input type="button" name="button1" value="GOTO"
onClick="test1(this.form)">
<P>
</form>
</body>
</html>

The substitued FORM that does work:

<form name="first">
THE ORGANIZATION YOU WANT TO GOTO IS<br>
<input type="text" name="text1">
<input type="button" name="button1" value="GOTO"
onClick="test1(this.form)">
<P>
</form>

COMMENTS:
unfortunately I want a selection box instead of a text input.
I will want this script and form to be in

 http://www.prostar.com/web/alpine/menu.htm

it is in a frame made by 

http://www.prostar.com/web/alpine/index.htm

I want it to update the middle frame. its name is also middle.
Please help.

Aaron Peterson
Aaron.Peterson@mail.Prostar.com

ALPine information exchange
http://www.prostar.com/web/alpine/
Re: Please tell my why this won't work.
#47
Author: Danny Goodman
Date: Thu, 08 Aug 1996 00:00
15 lines
1795 bytes
Aaron Peterson wrote:
> <select name="test1">
>         <option selected value="ALPine">ALPine
>         <option value="INCOR">INCOR
> </select>
> <input type="button" name="button1" value="GOTO"
> onClick="test1(this.form)">

Avoid assigning the same names to objects and functions.  I have seen
that confuse JavaScript from time to time.

Danny
"Danny Goodman's JavaScript Handbook"
http://www.dannyg.com
Re: Please tell my why this won't work.
#48
Author: Peng Khor
Date: Fri, 09 Aug 1996 00:00
62 lines
2977 bytes
Aaron Peterson wrote:
> 
> The Error:
> 
> JavaScript Error: file:/C|WINDOWS/Desktop/otog5.htm, line 7:
> Window.Document.Form.text1 has no property named 'value'.
> 
> The HTML and SCRIPT and FORM:
> 
> <html>
> <head>
> <script language="JavaScript">
> <!-- Hide
> 
> function test1(form) {
>   if (form.text1.value == "")
>     alert("Please enter a string!")
>   else {
>    if (form.text1.value == "INCOR")
>      parent.location.href="http://www.prostar.com/web/alpine/incor/";
>   else {
>    if (form.text1.value == "ALPine")
> 
> parent.location.href="http://www.prostar.com/web/alpine/welcome.htm";}
>    }
> }
> 
> // -->
> </script>
> </head>
> 
> <body>
> <form name="first" method="post">
> THE ORGANIZATION YOU WANT TO GOTO IS<br>
> <select name="test1">

1.0  The "test1" should be "text1"

>         <option selected value="ALPine">ALPine
>         <option value="INCOR">INCOR
> </select>
> <input type="button" name="button1" value="GOTO"
> onClick="test1(this.form)">
> <P>
> </form>
> </body>
> </html>

{snip}

2.0 The value for the selected "text1" is not picked up by the script. 
    I tested it. The script gives the value as "null".
    Perhaps, some more experienced in <FORM> can offer an explanation.

Peng Khor

-- 
=======================================================================
Peng Aun Khor		 Email	: Mailto:Peng.Khor@hydro.on.ca
H11 G04 Ontario Hydro	 Phone	: (416) 592 8396
Canada M5G 1X6		 Fax	: (416) 592 4849
Re: Please tell my why this won't work.
#49
Author: Peng A. Khor
Date: Sat, 10 Aug 1996 00:00
47 lines
2549 bytes
---------------------------------------------------------------------------

Just a followup and a solution to the problem.

You cannot use text1.value for the select parameter.
You must make use of the index of the options.

The following modified html works.

 <html>
 <head>
 <script language="JavaScript">
 <!-- Hide
 
 function test1(form) 
{
 
  index=form.text1.selectedIndex;  
  if (form.text1.options[index].text == "")
    {alert("Please enter a string!");}
  else if (form.text1.options[index].text == "INCOR")
   { parent.location.href="http://www.prostar.com/web/alpine/incor/";}
  else if (form.text1.options[index].text == "ALPine")
   {
parent.location.href="http://www.prostar.com/web/alpine/welcome.htm";}
 }
 // -->
 </script>
 </head>
 <body>
 <form name="first" method="post">
 THE ORGANIZATION YOU WANT TO GOTO IS<br>
 <select name="text1">
 <option selected value="ALPine">ALPine
 <option value="INCOR">INCOR
 </select>
 <input type="button" name="button1" value="GOTO"
 onClick="test1(this.form)">
 <P>
 </form>
 </body>
 </html>

 Have more fun in your web authoring !

Peng Khor
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads