Protocols/MSNP/Activities/SDK/Techref/Developing/Docbody
Document Body Basics
The body of the document presents information in HTML format. A scripting language such as Microsoft® Visual Basic Scripting Edition (VBScript) or JavaScript can be used to change text, formatting, or graphics by manipulating the Document Object Model (DOM). Any element that has an id attribute, such as a <span>, <td>, or <image> tag, can be referenced and manipulated by script. For more information on HTML page setup, see [[P../../GettingStarted|Getting Started]].
The following example shows one way to reference a span of text and change it by using the innerHTML property.
In the script area:
<script type="JavaScript"> <!-- // change a span of text samplename.innerHTML="Sample User"; </script> //-->
In the display area:
<span id="samplename">user name goes here</span>
The following example shows one way to reference an image and change its contents by using the src property.
In the script area:
<script type="JavaScript"> <!-- // preloader ImageA = new Image(); ImageA.src = "loading.jpg" // change image to say Loading... loadingprogress1.src=ImageA.src; </script> //-->
In the display area:
<img id="loadingprogress1" src="empty.gif">