WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 21.09.2001, 13:52   #1
RaistlinMajere
Inventar
 
Registriert seit: 06.04.2001
Alter: 44
Beiträge: 2.343


Standard js - innerHTML auch für ns?

bekanntlich kann man per

document.getElementById("layername").innerHTML = "blablabla";

den inhalt eines layers generieren. leider funzts fürn ns nicht mit

document.layers["layername"].innerHTML = "blablabla";

weiß jemand, wie´s geht?
____________________________________
"Life is like a box of rockets," said the Marine. "You never know what you´re gonna ret."
Then he pulled the trigger of his BFG9000.
RaistlinMajere ist offline   Mit Zitat antworten
Alt 24.09.2001, 12:31   #2
RaistlinMajere
Inventar
 
Registriert seit: 06.04.2001
Alter: 44
Beiträge: 2.343


Unglücklich offensichtlich niemand

aber umgehen läßt sich das problem auf jeden fall mit php, wo der inhalt des layers browserabhängig generiert werden kann.
interessant wärs trotzdem, wies mit js geht.
____________________________________
"Life is like a box of rockets," said the Marine. "You never know what you´re gonna ret."
Then he pulled the trigger of his BFG9000.
RaistlinMajere ist offline   Mit Zitat antworten
Alt 27.09.2001, 02:06   #3
_m3
Inventar
 
Registriert seit: 24.09.2001
Beiträge: 7.335


Böse Nicht W3C konform !

Google ist Dein Freund:

<http://sites.netscape.net/ekrockhome...html#innerhtml>
innerHTML Convenience Extension in Mozilla/Netscape 6
The innerHTML property of elements as found in IE is not a feature of the W3C DOM. The contents of an element can be set by using methods of the W3C DOM Level 1. To assure the widest interoperability of code, Netscape recommends as a matter of standard policy that developers base their code on web standards rather than proprietary extensions whenever possible. However, in response to requests from web developers, mozilla.org has added support for the innerHTML DOM extension to Gecko, Mozilla and Netscape 6 builds after 19 May 2000 (Mozilla M16 and later, Netscape 6 PR2 and later). Developers who wish are welcome to use innerHTML, but they should be aware that innerHTML is not part of any standard and therefore code that uses it will be specific to IE4 and later, Netscape 6 PR2 and later, and browsers based on Mozilla and the Gecko layout engine.

Sollte also mit neueren Browsern kein Problem sein.

W3C konform aus <http://developer.netscape.com/viewso...dman_cross.htm>:
Notice one important point about nodes that represent HTML elements: the nodeValue of an element node is null. You might expect instead that the value would be something akin to the innerHTML property that first surfaced in Internet Explorer 4. The four related IE properties (innerHTML, innerText, outerHTML, and outerText) are not part of the DOM specification (but it sure would be great if the DOM working group could find a way to slip them into the final draft of Level 2). To modify an HTML element's content and be compatible with the Level 1 DOM, you must look to the node object's methods.
Node Methods
To create a new element node by script, you typically begin with the createElement() method of the document object. The sole parameter is a string of the tag for the element. For example:

var newElem = document.createElement("P")

The object generated at this point resides only in memory and is not yet part of the document (it has no parent, siblings, or children). Nor does it have any attributes or content associated with it. You can set attribute values by way of property assignments (the simplest way) or via the setAttribute() method of a DOM element. After creating the element above, you can assign it an ID with either

newElem.id = "newP"

or

newElem.setAttribute("id","newP")

To give this new paragraph element some text content, you must go back to the document object well once more to generate a node that holds text, using createTextNode():

var newText = document.createTextNode("This is the second paragraph.")
____________________________________
Weiterhin zu finden auf http://martin.leyrer.priv.at , http://twitter.com/leyrer , http://www.debattierclub.net/ , http://www.tratschen.at/ und via Instant Messaging auf Jabber: m3 <ät> cargal.org .
_m3 ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 18:08 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag