Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.sao.ru/cats/~satr/JS/REF/tags17.htm
Дата изменения: Wed Jan 28 07:31:00 1998 Дата индексирования: Tue Oct 2 05:32:36 2012 Кодировка: Поисковые слова: п п п п р п р п р п р п р п р п р п р п р п р п |
Opening a Document in a Web Browser
To open a document in your browser, use a URL that specifies an absolute or relative location for the document. An absolute location has the form:
http://domain-name/pathname
For example:
http://www.netscape.com/comprod/index.html
A relative location can either be relative to the root path for the current document, in which case it begins with /, for example:
/comprod/index.htm
or relative to the directory containing the current document, for example:
images/image1.gif.
Opening a Local File
To open a local file in your web browser, use a URL that has the form:
file://directory/filename
For example:
file://rootdir/documents/htmlref/tags.htm
Use the file URL to examine local documents only; do not use it in documents that will be served by web servers.
Invoking JavaScript
You can invoke JavaScript by using a URL that has the form:
javascript:javascriptCode
For example:
<P>If you click on this link, you'll see a
<A HREF="javascript:checkBeforeProceeding();">
confirmation dialog box.</A> Opening a Mail Message Window
A URL that opens a mail message has the form:
mailto:address
For example:
mailto:support@somecompany.com
Netscape Navigator 2.0 introduced an extension to the mailto URL so it can initialize the contents of a mail composition window. You can provide default values for header fields in the mail message. Each field name must be separated by &
. For example, the following mailto URL opens a mail message addressed to support@somecompany.com. The subject field has the value "help needed", and the cc field has the value "carbon@somecompany.com."
mailto:support@somecompany.com?subject=help needed?cc=carbon@somecompany.com
If the URL is used in a link, any header fields that do not correspond exactly to headers you can edit in a mail composition window are ignored. However, if it is used as the POST address of a form submission, all headers are generated, even unknown ones, except for "dangerous" headers. The headers that form submissions cannot set or override the default values are:
mailto:support@somecompany.com?subject=help needed?New lines in the body must be hex encoded. For example, use %0A to indicate new lines. Not all browsers understand mailto URLs.
cc=carbon@somecompany.com?body=I need some help with version 3.15798 of the ABC software product.
ftp://ftpdomain/For example:
ftp://ftp.netscape.com/
news:newserverFor example:
news:alt.rec.recipes
gopher://gopher.somehost.com
http://hoohoo.ncsa.uiuc.edu:80/cgi/overview.html
To specify a URL that invokes a CGI program, specify the location of the CGI program, followed by a query string which contains the arguments for the program. A query string consists of a question mark, followed by the name/value pairs to be submitted to the program. Each name/value pair is separated by an &. Use the URL-encoded value %20 to indicate white spaces and %0A to indicate new lines. The following example invokes the program "compute.cgi" that takes three arguments. The value of the argument val1 is 25, val2 is 39, and text is "how now brown cow".http://www.somecompany.com/Note that in the above example there should be no line breaks; the line break shown is for readability only. URLs for CGI programs can be absolute or relative, as discussed in Opening a Document in a Web Browser.
cgi-bin/compute.cgi?val1=25&val2=39&text=how%20now%20brown%20%cow
Last Updated: 01/26/98 21:33:44