Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
HTML
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Scripts/DHTML== Script-Programme werden wahlweise direkt in der HTML-Datei oder in separaten Dateien notiert. Sie werden nicht - wie etwa Java-Programme - compiliert, sondern als Quelltext zur Laufzeit interpretiert, also ähnlich wie Batchdateien bzw. Shellscripts. Dazu besitzen moderne WWW-Browser wie Netscape oder Microsoft Internet Explorer entsprechende Interpreter-Software. By embedding scripts in a document you can access the HTML objects to manipulate the elements on a Web page. A minimal HTML object model was first introduced as part of NN 2.0 JavaScript implementation. IE 3.0 separated the original object model for describing the document from the language implementation. IE 4.0 built on this object model to completely expose all aspects of the document. Developers designed the DHTML object model as a superset of the existing model. The ability to access and change any aspect of a page demonstrates one of the key innovations enabled by DHTML. Whenever a script manipulates and changes an attribute of an element or a style sheet or modifies the contents, the document intelligently recalculates and repaints the page. The DHTML object model exposes a reflection of the document to the scripting language. A HTML document can contain any number of script elements. A script element can live in either the head or the body. Scripts that execute during the parsing of a page and that reference elements on the page need to be positioned carefully because only those elements are available that have been loaded prviously. Therefore you should check for the existance of the object. Es gibt keine festen Vorschriften dafür, an welcher Stelle einer HTML-Datei ein JavaScript-Bereich definiert werden muß. Es ist unter JavaScript-Programmierern zur Gewohnheit geworden, einen solchen Bereich im Kopf der HTML-Datei, also zwischen <head> und </head> zu definieren und durch HTML-Kommentare zu klammern. Dadurch ist am ehesten sichergestellt, daß der Code vom WWW-Browser bereits eingelesen ist und zur Verfügung steht, wenn er ausgeführt werden soll. <head> <!-- nicht zwingend im Head Bereich --> '''<script ['''type="'''text/javascript'''"'''] ['''src="'''<Filename>'''"'''] ['''Defer''']> <Script statements> '''</script>''' </head> If the '''language''' attribute is missing '''JavaScript''' is used. Die Script Sprache kann auch über den MIME type eingestellt werden. Scripts contained within a Script element can execute code in two contexts: during the parsing of the page and as the result of an event. Ein sogenannter EventHandler wird an den HTML-Tags spezifiziert. Das Attribut beginnt in der Regel mit '''on'''<Event> gefolgt von einem '''='''-Zeichen und dem JavaScript-Code. Alles was nicht in einer Function steht direkt beim Laden der Page ausgeführt. So kann es u.U. sinnvoll sein den Code am Ende zu plazieren, damit bestimmte Felder initial gefüllt werden. Browser that support the '''src''' tag ignore the contents of the script element. The '''defer''' attribute tells the browser that it does not need to wait until the script is parsed but can continue to load the page. Variables and functions that are scoped to the window object e.g. declared in the statement block are added to the ''window'' object as properties. Therefore it is possible to call a function from one script statement in another script statement even if they are implemented in a different language. Code that calls a function while the page is loading must have the function declared in advance . This feature can be used to find out which Scripting language is supported by the browser . To prevent that down-level browser will render the script code as HTML text the code should be wrapped in comment, while the closing comment is preceeded by the language-specific comment delineator , but be careful not to put the HTML comment anywhere as a string in your code section. In a '''<NOSCRIPT>''' <HTML statements> '''</NOSCRIPT>''' section there can be a note that the current browser does not support scripting . For browser that do not support the '''<NOSCRIPT>''' tag it is possible to put a note in the code section . Another solution might be to test the browser version and switch to another page . Die Quellen in eine Source-Datei abzulegen ist eine simple Möglichkeit die Quellen zu schützen. Leider kann man den Schutz mit '''<a href="<URL>\<SourcePath>\<SourceFile>"> Load <\a>''' leicht umgangen werden.
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width